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 buildlogsarchiver
while read -r msg; do
logger -i -t buildlogsarchiver "$msg"
done

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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