Let Cloud Run Job use StructuredLogHandler
instead of ClougLoggingHandler
#890
Labels
api: logging
Issues related to the googleapis/python-logging API.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Is your feature request related to a problem? Please describe.
When using
Client.get_default_handler
CloudLoggingHandler
is being used automatically for Cloud Run jobs resource. And while #877 fixes the missing labels we're still gonna be using background transport when simplier stdout is doing just fine.Describe the solution you'd like
If we modify this check
python-logging/google/cloud/logging_v2/client.py
Line 388 in 6264107
_RUN_RESOURCE_TYPE
OR_CLOUD_RUN_JOB_RESOURCE_TYPE
resource type then a structured log handler is gonna be used automatically which should be a better default.Describe alternatives you've considered
Meanwhile I am using
handler = StructuredLogHandler(project_id=client.project)
instead ofhandler = client.get_default_handler()
where client isclient = CloudLoggingClient()
The text was updated successfully, but these errors were encountered: