Opened 3 hours ago

#36958 new Uncategorized

Reload logging when logging setting changed

Reported by: Jake Howard Owned by:
Component: Core (Other) Version: 6.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When changing the LOGGING setting (eg in tests), logging config isn't reconfigured to match.

This can be fairly easily added in a project:

@receiver(setting_changed)
def reload_logging_config(*, setting: str, **kwargs: Any) -> None:
    if setting in {"LOGGING", "LOGGING_CONFIG"}:
        configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)

But it would be nice if this was handled by default. This snippet appears to do what I need, but there might be edge cases I've not considered.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top