Log tripleo services to syslog

Logging to an upstart logfile results in log entries that are not
associated with a timestamp(e.g. os-collect-config). This isn't
consistent with the log files produced in other openstack CI tests
and means we can't index them in logstash (at least consistently
with how the other projects are indexed).

As a result of this we will need to remove the double time stamps that
get produced (by taking them out in each of the services configuration)
and extract the log at the end of CI into per-service files so that we
can selectively index the files we want.

In particular the service that doesn't contain timestamps in all of the
log entries is os-collect-config which is arguably one of the most
important service logs we want indexed. We could simply just divert this
service alone to syslog but doing them all is more consistent with other
distros and how this will presumably work when ubuntu moves to systemd.

Change-Id: Ib8c1fc39d56b2b9c6d8e9b64a868def619aa2f1f
This commit is contained in:
Derek Higgins 2014-07-03 17:35:50 +01:00
parent 8739e40147
commit 1ad23b193f
2 changed files with 9 additions and 2 deletions

View File

@ -38,7 +38,11 @@ if [ "$DIB_INIT_SYSTEM" == "upstart" ] ; then
start on runlevel [2345]
stop on runlevel [016]
respawn
exec os-collect-config
# We're logging to syslog
console none
exec os-collect-config 2>&1 | logger -t os-collect-config
eof
elif [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then

View File

@ -128,7 +128,10 @@ respawn
# not hit the default of 10 times in 5 seconds. Make it 2 times in 5s.
respawn limit 2 5
exec start-stop-daemon --start -c $user --exec $install_dir/bin/$cmd -- $args
# We're logging to syslog
console none
exec start-stop-daemon --start -c $user --exec $install_dir/bin/$cmd -- $args 2>&1 | logger -t $name
post-start $POSTSTART
EOF