Skip to content

[LOGGING] Disabling base logger propagation breaks logs #15149

Closed as not planned

Description

@yemreck

googleapis/google-auth-library-python#1678

While checking for is logging enabled,

https://github.com/googleapis/google-auth-library-python/blob/56b4d3b3bfd6f935411130c8828cdeea90aa69f1/google/auth/_helpers.py#L381-L382

these lines disables root level propagation if base logger is not configured.

However this breaks all children loggers, causing them to be NOTSET.

This leads logger.isEnabledFor(logging.DEBUG) to return True on not configured loggers. Normally they would propagate to WARNING level.

This bug causes unnecessary costly json parsing on response_log.

Environment details

  • OS:
  • Python version:
  • pip version:
  • google-auth version: >=2.40.0

Activity

  1. ohmayr commented on May 20, 2025

    @ohmayr
    Contributor

    @keepdying Thanks for reporting this! I think the idea behind disabling base logger propagation is exactly what you've mentioned here i.e. to not emit logs if a logger with a namespace google or google.* is not explicitly configured (even if the user has the root logger configured). As an example, you can refer to the following documentation for more detail.

    This leads logger.isEnabledFor(logging.DEBUG) to return True on not configured loggers.

    Can you provide an example (sample code) which leads to the above behavior?

  2. parthea commented on Jan 12, 2026

    @parthea
    Contributor

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

  3. daniel-sanche commented on May 28, 2026

    @daniel-sanche
    Contributor

    This issue is being bulk closed due to inactivity. Please re-open if you think this still requires attention, and we'll take another look. Thanks!

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions