Skip to content
Snippets Groups Projects
Verified Commit eaf11099 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Explicitly configure Celery logger

parent 61cfad60
No related branches found
No related tags found
No related merge requests found
import logging
import os import os
from traceback import format_exception from traceback import format_exception
...@@ -39,5 +40,5 @@ def task_failure_notifier( ...@@ -39,5 +40,5 @@ def task_failure_notifier(
@setup_logging.connect @setup_logging.connect
def on_setup_logging(*args, **kwargs): def on_setup_logging(*args, **kwargs):
"""Prevent Celery from overriding logging configuration.""" """Load Django's logging configuration when running inside Celery."""
pass # noqa logging.config.dictConfig(settings.LOGGING)
...@@ -902,6 +902,12 @@ if not _settings.get("logging.disallowed_host", False): ...@@ -902,6 +902,12 @@ if not _settings.get("logging.disallowed_host", False):
"handlers": ["null"], "handlers": ["null"],
"propagate": False, "propagate": False,
} }
# Configure logging explicitly for Celery
LOGGING["loggers"]["celery"] = {
"handlers": ["console"],
"level": _settings.get("logging.level", "WARNING"),
"propagate": False,
}
# Rules and permissions # Rules and permissions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment