Skip to content

Commit

Permalink
Fix configuring loggers found in 'PREFECT_LOGGING_EXTRA_LOGGERS'
Browse files Browse the repository at this point in the history
Each logger defined in 'PREFECT_LOGGING_EXTRA_LOGGERS' now has their level set according to the 'prefect.extra' level. Previously, this only occurred when their level was NOTSET.

Additionally, avoid configuring the logger 'level' and 'propagate' values while iterating over 'extra_config.handlers'

Resolves #15370
  • Loading branch information
Eric Stasney (estasney) committed Jan 8, 2025
1 parent 0fc38cf commit 3ea8b53
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/prefect/logging/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,11 @@ def setup_logging(incremental: Optional[bool] = None) -> dict[str, Any]:

for logger_name in PREFECT_LOGGING_EXTRA_LOGGERS.value():
logger = logging.getLogger(logger_name)
logger.setLevel(extra_config.level)
logger.propagate = extra_config.propagate
for handler in extra_config.handlers:
if not config["incremental"]:
logger.addHandler(handler)
if logger.level == logging.NOTSET:
logger.setLevel(extra_config.level)
logger.propagate = extra_config.propagate

PROCESS_LOGGING_CONFIG = config

Expand Down

0 comments on commit 3ea8b53

Please sign in to comment.