Added kimai2 log to stdout through supervisor

This commit is contained in:
2019-07-14 12:37:57 -05:00
parent 52582f8eab
commit b95b7711df
16 changed files with 197 additions and 9 deletions
+14
View File
@@ -0,0 +1,14 @@
[group:kimai-log]
programs=kimai-log
priority=20
[program:kimai-log]
command = /opt/docker/bin/service.d/kimai-log.sh
process_name=%(program_name)s
startsecs = 0
autostart = true
autorestart = false
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
LOG_PATH="/app/var/log/${APP_ENV}.log"
# only attempt logging if we have enabled logging
# and the log file exists.
if [ "${APP_LOG}" == "1" ]
then
if [ -f ${LOG_PATH} ]
then
# attempt to tail the log one line at a time.
# the supervisor job will push output to STDOUT.
echo "Now tailing ${LOG_PATH}..."
tail -f -n 1 ${LOG_PATH}
else
echo "Cannot find ${LOG_PATH}. Will now exit..."
fi
fi