Comment 5 for bug 1571714

Revision history for this message
Ben Nemec (bnemec) wrote :

Shoot, apparently I wasn't subscribed to this bug so I didn't see the responses.

I am inclined to agree that this should be fixed in oslo.messaging, but I think we need to do _something_ different in oslo.log too. In this case the caller thought the call was okay because the password field wasn't referenced in the log message so it doesn't show up in any of the other formatters. The behavior here is significantly different.

Which makes me wonder why we're even logging args. One could argue that's internal data used to build the log message, not something that is supposed to be exposed to users. The logging docs even suggest this: https://docs.python.org/2/library/logging.html#logrecord-attributes "You shouldn’t need to format this yourself."

I think the JSONFormatter shouldn't be logging args or msg since those are just the building blocks for "message", which should contain all of the necessary information after formatting. While this could be considered a breaking change, realistically nobody should be relying on the content of args anyway. There's nothing about the keys passed in a log call that would be treated as an API so keys may be added/removed/renamed at any time with no warning. If data from args is needed, it should be included in the message explicitly.