From b72a736649a3438c23497f14161eedc670d9dbc9 Mon Sep 17 00:00:00 2001 From: adinhodovic Date: Fri, 31 May 2024 16:15:26 +0200 Subject: [PATCH] fix: Add structlog init step celery --- config/celery_app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/celery_app.py b/config/celery_app.py index 9bbc5a8..78b3355 100644 --- a/config/celery_app.py +++ b/config/celery_app.py @@ -6,6 +6,7 @@ from celery.schedules import crontab from celery.signals import setup_logging, worker_ready, worker_shutdown from django.conf import settings +from django_structlog.celery.steps import DjangoStructLogInitStep # set the default Django settings module for the 'celery' program. os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production") @@ -18,6 +19,8 @@ # should have a `CELERY_` prefix. app.config_from_object("django.conf:settings", namespace="CELERY") +app.steps["worker"].add(DjangoStructLogInitStep) + @setup_logging.connect def config_loggers(*args, **kwargs):