Title: log_struct severity isn't captured as expected · Issue #190 · googleapis/python-logging · GitHub
Open Graph Title: log_struct severity isn't captured as expected · Issue #190 · googleapis/python-logging
X Title: log_struct severity isn't captured as expected · Issue #190 · googleapis/python-logging
Description: What is the issue: On using Python client library for Cloud Logging, log_struct is used to send structured logs to Cloud Logging. In structured logging, the log message and metadata are stored in Python dictionary and it is passed to the...
Open Graph Description: What is the issue: On using Python client library for Cloud Logging, log_struct is used to send structured logs to Cloud Logging. In structured logging, the log message and metadata are stored in P...
X Description: What is the issue: On using Python client library for Cloud Logging, log_struct is used to send structured logs to Cloud Logging. In structured logging, the log message and metadata are stored in P...
Opengraph URL: https://github.com/googleapis/python-logging/issues/190
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"log_struct severity isn't captured as expected","articleBody":"## What is the issue: \r\nOn using Python client library for Cloud Logging, log_struct is used to send structured logs to Cloud Logging. In structured logging, the log message and metadata are stored in Python dictionary and it is passed to the 1st argument of the method. However, the severity field is not handled as expected because severity needs to be assigned as named argument, which is not explicit from the library document.\r\n\r\n## Link to friction log: \r\nhttps://docs.google.com/document/d/19Glb2LC1jXyARXLlJbdRjY1d7I2GolCntI5hck5PuGU/edit?usp=sharing\r\n\r\n## How bad is it on a scale of 1-5 (1=Minor Annoyance; 5=Total Work Blocker)\r\n\r\n4\r\n\r\n## What were you trying to do?\r\n\r\nThis issue was originally reported by the customer (TV Asahi), and I reproduced it.\r\n\r\nI tried to send structured logs to Cloud Logging with its Python client library.\r\n\r\n##What did you expect to happen?\r\n\r\nThe 1st argument of log_struct accept the dictionary with whole metadata valid for LogEntry and handle the log severity stored in that dictionary.\r\n\r\nThat is, expecting this code:\r\n```\r\nlogdata = {\r\n \"service\": service,\r\n \"message\": message,\r\n \"messageId\": context.event_id,\r\n \"timepublished\": context.timestamp,\r\n \"severity\": \"warning\"\r\n}\r\n\r\nvplogger.log_struct(logdata)\r\n```\r\nis treated as WARNING level log in Cloud Logging.\r\n\r\n## What actually happened?\r\n\r\nIt was treated as DEBUG level log.","author":{"url":"https://github.com/daniel-sanche","@type":"Person","name":"daniel-sanche"},"datePublished":"2021-02-18T23:08:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/190/python-logging/issues/190"}
| 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:0e0e399f-bc72-4f97-3b70-b3c92a9682ba |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D24C:B6C89:8917047:BF56F3B:6A505DA6 |
| html-safe-nonce | a748aea866455735ec4f9ccac4da64478d15ec43a4984836f2a0e4aca6fa3085 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjRDOkI2Qzg5Ojg5MTcwNDc6QkY1NkYzQjo2QTUwNURBNiIsInZpc2l0b3JfaWQiOiIyOTM2MjUzNzA2NDk5Mjg0MzkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f8db1a8f0448a6d1649fd38b48a3216b14ba1bfbfc6ab1329260bee5b2f9f15e |
| hovercard-subject-tag | issue:811543406 |
| 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/190/issue_layout |
| twitter:image | https://opengraph.githubassets.com/06dd90a6c98202e3119778a806a95b3327a09588cf7d7987f2e3ba01906f79c2/googleapis/python-logging/issues/190 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/06dd90a6c98202e3119778a806a95b3327a09588cf7d7987f2e3ba01906f79c2/googleapis/python-logging/issues/190 |
| og:image:alt | What is the issue: On using Python client library for Cloud Logging, log_struct is used to send structured logs to Cloud Logging. In structured logging, the log message and metadata are stored in P... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | daniel-sanche |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| 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 | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width