Title: Generate a copy of json_fields before adding message · Issue #652 · googleapis/python-logging · GitHub
Open Graph Title: Generate a copy of json_fields before adding message · Issue #652 · googleapis/python-logging
X Title: Generate a copy of json_fields before adding message · Issue #652 · googleapis/python-logging
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"...
Open Graph 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. ...
X 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 sta...
Opengraph URL: https://github.com/googleapis/python-logging/issues/652
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generate a copy of json_fields before adding message ","articleBody":"### Description\r\nWe 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.\r\n\r\n```\r\npayload = {\"id\": 1}\r\nlogging.info(\"hello\", extra={\"json_fields\": payload})\r\n# payload becomes {\"id\": 1, \"message\": \"hello\"}\r\n```\r\n\r\n### Proposed solution\r\nMake a copy of the \"json_fields\" param inside extra before processing it.\r\n\r\n","author":{"url":"https://github.com/mat105","@type":"Person","name":"mat105"},"datePublished":"2022-10-19T16:42:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/652/python-logging/issues/652"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0157a272-a8c1-aef2-7f98-2bd8d42095cc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A3D4:223B9A:2CAD69:3C31CA:6A51BBEF |
| html-safe-nonce | 9c25264076bf16f1cd065828b03ff2f46ebc670081344c132f9ba14f7c235622 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0Q0OjIyM0I5QToyQ0FENjk6M0MzMUNBOjZBNTFCQkVGIiwidmlzaXRvcl9pZCI6IjExNDgzOTc5NzgxMTQ5NjQ0NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 62ced53c34f7b09d1f21489b64757e9d2fa05dbb42e3a25652109afb5992ef23 |
| hovercard-subject-tag | issue:1415289231 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-logging/652/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8825ad1b419a0733f082a1278eb109112cb5729e921bbf546a357f29428013af/googleapis/python-logging/issues/652 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8825ad1b419a0733f082a1278eb109112cb5729e921bbf546a357f29428013af/googleapis/python-logging/issues/652 |
| og:image:alt | 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. ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mat105 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-logging git https://github.com/googleapis/python-logging.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992562 |
| octolytics-dimension-repository_nwo | googleapis/python-logging |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992562 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-logging |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width