Log Global Request IDs by default

Global Request IDs were introduced a while ago[1] so that operators can
trace processing of resources across multiple services more easily.

Some services like Nova or Neutron have implemented this feature and
a request made by these services have additional global request id in
its context. However current default format doesn't include that new id
and users need to update the log format parameter in each service to
get this information recorded.

This change updates the default log format so that the Global Request
IDs can be more widely and easily used.

[1] https://specs.openstack.org/openstack/oslo-specs/specs/pike/global-req-id.html

Change-Id: I1adc9b29bb356ce56704c066b375b49374200d3c
This commit is contained in:
Takashi Kajinami 2022-04-16 00:13:19 +09:00
parent f31946fd89
commit 2ba348facb
2 changed files with 7 additions and 2 deletions

View File

@ -146,8 +146,8 @@ generic_log_opts = [
log_opts = [
cfg.StrOpt('logging_context_format_string',
default='%(asctime)s.%(msecs)03d %(process)d %(levelname)s '
'%(name)s [%(request_id)s %(user_identity)s] '
'%(instance)s%(message)s',
'%(name)s [%(global_request_id)s %(request_id)s '
'%(user_identity)s] %(instance)s%(message)s',
help='Format string to use for log messages with context. '
'Used by oslo_log.formatters.ContextFormatter'),
cfg.StrOpt('logging_default_format_string',

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
Default value of the ``[DEFAULT] logging_context_format_string`` option has
been updated and now Global Request IDs are logged by default.