mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
don't capture logs directly from stdout
previously in run_app_paas.sh, we captured stdout from the app and piped that into the log file. However, this came up with a bunch of problems, mainly that exceptions with stack traces often weren't formatted properly, and kibana could not parse them instead, with the updated utils library, we can use that to log json straight to the appropriate directory directly.
This commit is contained in:
@@ -52,11 +52,9 @@ function on_exit {
|
||||
kill 0
|
||||
}
|
||||
|
||||
function start_appplication {
|
||||
exec "$@" 2>&1 | while read line; do echo $line; echo $line >> /home/vcap/logs/app.log.`date +%Y-%m-%d`; done &
|
||||
LOGGER_PID=$!
|
||||
function start_application {
|
||||
exec "$@" &
|
||||
APP_PID=`jobs -p`
|
||||
echo "Logger process pid: ${LOGGER_PID}"
|
||||
echo "Application process pid: ${APP_PID}"
|
||||
}
|
||||
|
||||
@@ -69,7 +67,6 @@ function start_aws_logs_agent {
|
||||
function run {
|
||||
while true; do
|
||||
kill -0 ${APP_PID} 2&>/dev/null || break
|
||||
kill -0 ${LOGGER_PID} 2&>/dev/null || break
|
||||
kill -0 ${AWSLOGS_AGENT_PID} 2&>/dev/null || start_aws_logs_agent
|
||||
sleep 1
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user