[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


Ian,


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.

Before:

2015-12-18 18:22:52.788 DEBUG oslo_concurrency.lockutils
[*req-bcd393ce-523e-454e-b05a-7b80f82aaaf0
None None*] Acquired semaphore "singleton_lock" lock
/usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py:197

2015-12-23 17:21:12.570 DEBUG nova.quota
[*req-a65d797f-1e7e-48b4-a0b7-92f48e5f6bcd
admin demo*] Quota limits for project 9c011aa5646640abae282b9093515333:
{'project_id': u'9c011aa5646640abae282b9093515333'} reserve
/opt/stack/nova/nova/quota.py:559

After:

2015-12-18 18:28:10.890 DEBUG oslo_concurrency.lockutils
[*req-2d7df976-5004-4da2-83cc-2ed96ee42049
- - - - -*] Acquired semaphore "singleton_lock" lock
/usr/local/lib/python2.7/dist-packages/oslo_concurrency/lockutils.py:197

2015-12-23 17:24:44.228 11197 DEBUG nova.quota
[*req-bfc10adf-5a05-4fd1-a671-32547f48f391
bc455368223742729898fb85c995694d 9c011aa5646640abae282b9093515333 - - -*]
Quota limits for project 9c011aa5646640abae282b9093515333: {'project_id':
u'9c011aa5646640abae282b9093515333'} reserve
/opt/stack/nova/nova/quota.py:559

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

Ronald
-------------- 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