log_struct severity isn't captured as expected #190
Labels
api: logging
Issues related to the googleapis/python-logging API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Milestone
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 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.
Link to friction log:
https://docs.google.com/document/d/19Glb2LC1jXyARXLlJbdRjY1d7I2GolCntI5hck5PuGU/edit?usp=sharing
How bad is it on a scale of 1-5 (1=Minor Annoyance; 5=Total Work Blocker)
4
What were you trying to do?
This issue was originally reported by the customer (TV Asahi), and I reproduced it.
I tried to send structured logs to Cloud Logging with its Python client library.
##What did you expect to happen?
The 1st argument of log_struct accept the dictionary with whole metadata valid for LogEntry and handle the log severity stored in that dictionary.
That is, expecting this code:
is treated as WARNING level log in Cloud Logging.
What actually happened?
It was treated as DEBUG level log.
The text was updated successfully, but these errors were encountered: