JSON formatter doens't fill the request's context

Bug #1730329 reported by Juan Antonio Osorio Robles
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Juan Antonio Osorio Robles

Bug Description

Seems that the JSON formatter doesn't actually fill the context. Here's some samples of output with the JSON formatter set:



I would expect the user and project ID's to be present in the extra's section, but they're not.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.log (master)

Fix proposed to branch: master
Review: https://review.openstack.org/517894

Changed in oslo.log:
assignee: nobody → Juan Antonio Osorio Robles (juan-osorio-robles)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.log (master)

Reviewed: https://review.openstack.org/517894
Committed: https://git.openstack.org/cgit/openstack/oslo.log/commit/?id=1b012d0fc6811f00e032e52ed586fe37e157584d
Submitter: Zuul
Branch: master

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'.

    Closes-Bug: #1730329
    Depends-On: I2b245c1665c3587be3c476b803122788d186e5d5
    Change-Id: I765dae17d2ecadce1672f16e432e748d5233acf8

Changed in oslo.log:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/oslo.log 3.34.0

This issue was fixed in the openstack/oslo.log 3.34.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.