syslog: fix timestamp (#1579)

Previously the timestamp was locked to the time at which the logger
process started. This change parses messages in bash and then calls the
logger once for each message ignoring newlines (read -r) in order to
guarantee the timestamp is correct.
This commit is contained in:
Jimmy Zelinskie 2016-06-24 15:46:58 -04:00 committed by GitHub
parent 38b375b982
commit a40b065bd3
17 changed files with 51 additions and 17 deletions

View file

@ -4,4 +4,6 @@
sv check syslog-ng > /dev/null || exit 1
# Start the logger
exec logger -i -t nginx
while read -r msg; do
logger -i -t nginx "$msg"
done