Skip to content

Let Cloud Run Job use StructuredLogHandler instead of ClougLoggingHandler #15407

Open
googleapis/python-logging
#898

Description

@xSAVIKx

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 googleapis/python-logging#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 https://github.com/googleapis/python-logging/blob/62641075042a3da9bb9c059d963bad14a1586b1c/google/cloud/logging_v2/client.py#L388 and allow _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 of handler = client.get_default_handler() where client is client = CloudLoggingClient()

Activity

  1. added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    on Aug 5, 2024
  2. parthea commented on Jan 13, 2026

    @parthea
    Contributor

    Transferring to google-cloud-python as the code for python-logging will be migrated there in 1-3 weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

api: loggingIssues related to the Cloud Logging API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions