From 2ba348facba5b493440d12cfc1f9630193cba3ef Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 16 Apr 2022 00:13:19 +0900 Subject: [PATCH] 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 --- oslo_log/_options.py | 4 ++-- .../notes/log-global_request_id-f97e6d663e8a80b3.yaml | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/log-global_request_id-f97e6d663e8a80b3.yaml diff --git a/oslo_log/_options.py b/oslo_log/_options.py index 141c0d49..8f4d498f 100644 --- a/oslo_log/_options.py +++ b/oslo_log/_options.py @@ -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', diff --git a/releasenotes/notes/log-global_request_id-f97e6d663e8a80b3.yaml b/releasenotes/notes/log-global_request_id-f97e6d663e8a80b3.yaml new file mode 100644 index 00000000..f464d0f3 --- /dev/null +++ b/releasenotes/notes/log-global_request_id-f97e6d663e8a80b3.yaml @@ -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.