diff options
author | Takashi Kajinami <tkajinam@redhat.com> | 2022-04-16 00:13:19 +0900 |
---|---|---|
committer | Takashi Kajinami <tkajinam@redhat.com> | 2022-04-25 13:02:15 +0000 |
commit | 2ba348facba5b493440d12cfc1f9630193cba3ef (patch) | |
tree | 4d01a5f7d253890ed0c6e61897c15eb383aa2c85 | |
parent | f31946fd8925887ae026e99a504866339c1806de (diff) | |
download | oslo-log-2ba348facba5b493440d12cfc1f9630193cba3ef.tar.gz |
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
-rw-r--r-- | oslo_log/_options.py | 4 | ||||
-rw-r--r-- | releasenotes/notes/log-global_request_id-f97e6d663e8a80b3.yaml | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/oslo_log/_options.py b/oslo_log/_options.py index 141c0d4..8f4d498 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 0000000..f464d0f --- /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. |