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

Merge branch 'master' into 'feature/vuejs'

# Conflicts:
#   CHANGELOG.rst
parents 339c94a8 8d7b000d
No related branches found
No related tags found
1 merge request!1045Introduce Vuetify and GraphQL
Pipeline #82780 canceled
......@@ -14,6 +14,11 @@ Added
* Introduce GraphQL API
Fixed
~~~~~
* Celery's logging did not honour Django's logging level
`2.10.1`_ - 2022-07-24
----------------------
......
import logging
import os
from traceback import format_exception
from django.conf import settings
from celery import Celery
from celery.signals import task_failure
from celery.signals import setup_logging, task_failure
from .util.core_helpers import get_site_preferences
from .util.email import send_email
......@@ -35,3 +36,9 @@ def task_failure_notifier(
"traceback": "".join(format_exception(type(exception), exception, traceback)),
},
)
@setup_logging.connect
def on_setup_logging(*args, **kwargs):
"""Load Django's logging configuration when running inside Celery."""
logging.config.dictConfig(settings.LOGGING)
......@@ -943,6 +943,12 @@ if not _settings.get("logging.disallowed_host", False):
"handlers": ["null"],
"propagate": False,
}
# Configure logging explicitly for Celery
LOGGING["loggers"]["celery"] = {
"handlers": ["console"],
"level": _settings.get("logging.level", "WARNING"),
"propagate": False,
}
# 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