commit 1b012d0fc6811f00e032e52ed586fe37e157584d
Author: Juan Antonio Osorio Robles <email address hidden>
Date: Mon Nov 6 08:59:43 2017 +0000
Capture context in its own key for JSON-based formatters
The JSON formatter used to rely on services making their logging calls
and passing the context there. A call it expted would be
LOG.debug("Some message", context=context)
This would end up in the "extra" section of the logging record. This is
not usually the case, as projects don't always pass the context on that
call. This also applies to the Fluent formatter which is based on the
JSON one.
For the JSON formatter, we already are getting the context from the
record. So lets use that if no context was provided in the record's
'extra' section. Finally, this places the context in its own section,
which is named 'context'.
Reviewed: https:/ /review. openstack. org/517894 /git.openstack. org/cgit/ openstack/ oslo.log/ commit/ ?id=1b012d0fc68 11f00e032e52ed5 86fe37e157584d
Committed: https:/
Submitter: Zuul
Branch: master
commit 1b012d0fc6811f0 0e032e52ed586fe 37e157584d
Author: Juan Antonio Osorio Robles <email address hidden>
Date: Mon Nov 6 08:59:43 2017 +0000
Capture context in its own key for JSON-based formatters
The JSON formatter used to rely on services making their logging calls
and passing the context there. A call it expted would be
This would end up in the "extra" section of the logging record. This is
not usually the case, as projects don't always pass the context on that
call. This also applies to the Fluent formatter which is based on the
JSON one.
For the JSON formatter, we already are getting the context from the
record. So lets use that if no context was provided in the record's
'extra' section. Finally, this places the context in its own section,
which is named 'context'.
Closes-Bug: #1730329 7be3c476b803122 788d186e5d5 ce1672f16e432e7 48d5233acf8
Depends-On: I2b245c1665c358
Change-Id: I765dae17d2ecad