Skip to content

Commit

Permalink
fix: Add structlog init step celery
Browse files Browse the repository at this point in the history
  • Loading branch information
adinhodovic committed May 31, 2024
1 parent f7b8169 commit b72a736
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/celery_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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):
Expand Down

0 comments on commit b72a736

Please sign in to comment.