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:
parent
38b375b982
commit
a40b065bd3
17 changed files with 51 additions and 17 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in a new issue