Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add structlog init step celery #241

Merged
merged 1 commit into from
May 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading