You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2026. It is now read-only.
OS type and version: Google Cloud Container Optimized OS (gke-12314-gke401-cos-93-16623-295-14-v221129-c-pre)
Python version: 3.8.10
pip version: 22.3.1
google-cloud-logging version: 3.4.0
Steps to reproduce
Either use werkzeug for serving or configure a werkzeug logger
Setup a Google Cloud Logging Python client
Log to the werkzeug logger and notice that logs are not sent to Google Cloud Logging.
Code example
importloggingimportgoogle.cloud.logginglogger=logging.getLogger('werkzeug')
client=google.cloud.logging.Client()
client.setup_logging()
logger.info('hello from werkzeug')
logging.info('hello from the root logger')
This results in hello from werkzeug not being set to the global log.
Due to EXCLUDED_LOGGER_DEFAULTS werkzeug is excluded from the set of loggers that are sent to Google Cloud logging:
"""Exclude internal logs from propagating through handlers"""
EXCLUDED_LOGGER_DEFAULTS= (
"google.cloud",
"google.auth",
"google_auth_httplib2",
"google.api_core.bidi",
"werkzeug",
google.cloud.logging.Client.setup_logging() has an excluded_loggers kwarg but setting that does not change the set of loggers that are ignored by the library due to the default set being added back into the set of ignored loggers in
Environment details
OS type and version: Google Cloud Container Optimized OS (gke-12314-gke401-cos-93-16623-295-14-v221129-c-pre)
Python version: 3.8.10
pip version: 22.3.1
google-cloud-loggingversion: 3.4.0Steps to reproduce
Code example
This results in
hello from werkzeugnot being set to thegloballog.Due to
EXCLUDED_LOGGER_DEFAULTSwerkzeug is excluded from the set of loggers that are sent to Google Cloud logging:python-logging/google/cloud/logging_v2/handlers/handlers.py
Lines 27 to 33 in fceb6f3
google.cloud.logging.Client.setup_logging()has anexcluded_loggerskwarg but setting that does not change the set of loggers that are ignored by the library due to the default set being added back into the set of ignored loggers inpython-logging/google/cloud/logging_v2/handlers/handlers.py
Line 294 in fceb6f3
The only workaround is to patch
EXCLUDED_LOGGER_DEFAULTSto removewerkzeugfrom the list.