[openstack-dev] [devstack][QA] Changing logging format to match documented defaults

Ronald Bradford me at ronaldbradford.com
Wed Dec 23 17:57:07 UTC 2015


On Tue, Dec 22, 2015 at 3:22 PM, Ian Wienand <iwienand at redhat.com> wrote:
> On 12/23/2015 05:55 AM, Ronald Bradford wrote:
> > I have observed that devstack uses custom logging formatting that
> > differs from the documented defaults. An example is for nova.  which
> > is defined in [1]
> The original point mentioned there of using "*_name" for extra
> verbosity still seems relevant [1]
> > logging_context_format_string = %(asctime)s.%(msecs)03d %(levelname)s
> > %(name)s [%(request_id)s *%(user_identity)s*] %(instance)s%(message)s
> user_identity is still just "{user} {tenant} ..." (which is id's, I
> believe?) [2].

For reference, here are messages using before and after suggestions with
and without context. Presently, the default value defines 5 distinct
components including user and tenant/project.


2015-12-18 18:22:52.788 DEBUG oslo_concurrency.lockutils
None None*] Acquired semaphore "singleton_lock" lock

2015-12-23 17:21:12.570 DEBUG nova.quota
admin demo*] Quota limits for project 9c011aa5646640abae282b9093515333:
{'project_id': u'9c011aa5646640abae282b9093515333'} reserve


2015-12-18 18:28:10.890 DEBUG oslo_concurrency.lockutils
- - - - -*] Acquired semaphore "singleton_lock" lock

2015-12-23 17:24:44.228 11197 DEBUG nova.quota
bc455368223742729898fb85c995694d 9c011aa5646640abae282b9093515333 - - -*]
Quota limits for project 9c011aa5646640abae282b9093515333: {'project_id':
u'9c011aa5646640abae282b9093515333'} reserve

You can see within the [context] the change to using more information to
identify the user, and ids rather than name. The goal of this change
however is to ensure the context string is consistent across various
projects and is what is in place to be deployed in production systems.

As mentioned by Doug, there is an additional option to specify an
alternative format of user_identity (if necessary). However I have found to
make the message identical to historical name values, the minimum
requirements of oslo.log in nova would need to bump from 1.8.0 to 1.14.0

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20151223/8d149455/attachment.html>

More information about the OpenStack-dev mailing list