Red Hat Bugzilla – Bug 963542
daemons should log to syslog instead of using ConcurrentLogHandler
Last modified: 2018-02-05 19:41:31 EST
ConcurrentLogHandler has caused us a fair bit of grief since we switched to it (for example bug 952929, bug 858922, bug 856850). It's messy and fairly wasteful, acquiring and releasing a flock for every log entry written.
We could greatly simplify Beaker's logging by sending everything to syslog instead. There would be no need to configure log levels or log rotation on the Beaker side anymore, each daemon would just choose between logging to stderr in the foreground or syslog when backgrounded. Log level filtering and storage would be the syslog daemon's job. We could ship a config file in /etc/rsyslog.d which sets up the same log destinations as we currently have, and a config file in /etc/logrotate.d which sets up the same rotation.
The only downside I can see so far is that syslog can only log one line at a time, so tracebacks for exceptions would need to be split into a separate log message for each line. That's fine, it just means that two concurrently logged tracebacks may be interleaved with each other. I don't see that as a serious problem though.
Also in future, when Beaker can assume the presence of systemd, we would be able to swap out syslog for the journal API. The systemd journal gives us the same functionality as syslog+logrotate but with heaps of other niceties on top as well.
On Gerrit: http://gerrit.beaker-project.org/2080
Beaker 0.14.1 has been released.