- Notifications
You must be signed in to change notification settings - Fork 57
Closed
Labels
api: loggingIssues related to the googleapis/python-logging API.Issues related to the googleapis/python-logging API.logging-resiliencepriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Description
We had a problem where we wanted to log a payload to another service via "json_fields", however, the logging handler added the key "message" to the payload so we started having errors.
payload = {"id": 1} logging.info("hello", extra={"json_fields": payload}) # payload becomes {"id": 1, "message": "hello"}
Proposed solution
Make a copy of the "json_fields" param inside extra before processing it.
Metadata
Metadata
Assignees
Labels
api: loggingIssues related to the googleapis/python-logging API.Issues related to the googleapis/python-logging API.logging-resiliencepriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.