[Openstack] Formatting log messages

Macdonald-Wallace, Matthew matthew.macdonald-wallace at hp.com
Tue Oct 15 14:45:24 UTC 2013


Hi all,

I'm working on migrating from the "default" logging mechanism to using log_config and the various handlers available to me.

I have a copy of the logging.conf file from [0] in my devstack /etc/nova/ directory and I've added "log_config = /etc/nova/logging.conf" to my nova.conf file, however the format has changed ever so subtly:

*default*:

%(asctime)s.%(msecs)d %(levelname)s %(name)s %(instance)s%(message)s from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d
2013-10-15 15:39:27.128 DEBUG amqp Closed channel #1 from (pid=31987) _do_close /usr/local/lib/python2.7/dist-packages/amqp/channel.py:95

*using logging handlers*:

%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [-] %(instance)s%(message)s
2013-10-15 15:40:21,981.981 32031 INFO nova.openstack.common.rpc.common [-] Connected to AMQP server on localhost:5672

NOTE: The milliseconds are repeated with a "." between them

[1] and [2] suggest that I should be able to override the value from the handler and set it back to the original value, however it does not appear to take effect.

Can anyone shed any light on this for me please?

Thanks,

Matt


[0] https://raw.github.com/openstack/nova/master/etc/nova/logging_sample.conf
[1] https://github.com/openstack/nova/blob/master/nova/openstack/common/log.py#L112
[2] https://github.com/openstack/nova/blob/master/nova/openstack/common/log.py#L117





More information about the Openstack mailing list