[openstack-dev] [TripleO] Using python logging.conf for openstack services

Gregory Haynes greg at greghaynes.net
Thu Dec 4 23:20:53 UTC 2014

Hello TripleOers,

I got a patch together to move us off of our upstart exec <service> |
logger -t <service> hack [1] and this got me wondering - why aren't we
using the python logging.conf supported by most OpenStack projects [2]
to write out logs to files in our desired location? 

This is highly desirable for a couple reasons:

* Less complexity / more straightforward. Basically we wouldn't have to
run rsyslog or similar and have app config to talk to syslog then syslog
config to put our logs where we want. We also don't have to battle with
upstart + rsyslog vs systemd-journald differences and maintain two sets
of configuration.

* We get actual control over formatting. This is a double edged sword in
that AFAICT you *have* to control formatting if you're using a
logging.conf with a custom log handler. This means it would be a bit of
a divergence from our "use the defaults" policy but there are some
logging formats in the OpenStack docs [3] named "normal", maybe this
could be acceptable? The big win here is we can avoid issues like having
duplicate timestamps [4] (this issue still exists on Ubuntu, at least)
without having to do two sets of configuration, one for upstart +
rsyslog, one for systemd.

* This makes setting custom logging configuration a lot more feasible
for operators. As-is, if an operator wants to forward logs to an
existing central log server we dont really have a good way for them to
do this. We also have a requirement that we can come up with a way to
expose the rsyslog/journald config options needed to do this to
operators. If we are using logging.conf we can just use our existing
passthrough-config system to let operators simply write out custom
logging.conf files which are already documented by OpenStack.

Thoughts? Comments? Concerns?


[1] - https://review.openstack.org/#/c/138844/
[2] -
* Note that Swift does not support this
[3] -
[4] - https://review.openstack.org/#/c/104619/

  Gregory Haynes
  greg at greghaynes.net

More information about the OpenStack-dev mailing list