Skip to content

Commit

Permalink
feat: use celery structlog logging
Browse files Browse the repository at this point in the history
  • Loading branch information
adinhodovic committed May 31, 2024
1 parent b6d8f03 commit dae647a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion config/celery_app.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import os
from logging.config import dictConfig
from pathlib import Path

from celery import Celery, bootsteps
from celery.schedules import crontab
from celery.signals import worker_ready, worker_shutdown
from celery.signals import setup_logging, worker_ready, worker_shutdown
from django.conf import settings

# set the default Django settings module for the 'celery' program.
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
Expand All @@ -17,6 +19,11 @@
app.config_from_object("django.conf:settings", namespace="CELERY")


@setup_logging.connect
def config_loggers(*args, **kwargs):
dictConfig(settings.LOGGING)


HEARTBEAT_FILE = Path("/tmp/worker_heartbeat")
READINESS_FILE = Path("/tmp/worker_ready")

Expand Down

0 comments on commit dae647a

Please sign in to comment.