Skip to content

Commit

Permalink
feat: config celery logging via Django (#7371)
Browse files Browse the repository at this point in the history
* feat: config celery logger via Django

* feat: Disable celery's logging config
  • Loading branch information
jennifer-richards authored and NGPixel committed May 14, 2024
1 parent 8f87573 commit d2623de
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
10 changes: 8 additions & 2 deletions ietf/celeryapp.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import os
import scout_apm.celery

from celery import Celery
import celery
from scout_apm.api import Config


# Disable celery's internal logging configuration, we set it up via Django
@celery.signals.setup_logging.connect
def on_setup_logging(**kwargs):
pass


# Set the default Django settings module for the 'celery' program
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ietf.settings')

app = Celery('ietf')
app = celery.Celery('ietf')

# Using a string here means the worker doesn't have to serialize
# the configuration object to child processes.
Expand Down
14 changes: 9 additions & 5 deletions ietf/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,21 @@ def skip_unreadable_post(record):
'level': 'INFO',
},
'django.security': {
'handlers': ['console', ],
'handlers': ['console', ],
'level': 'INFO',
},
'oidc_provider': {
'handlers': ['debug_console', ],
'level': 'DEBUG',
},
'oidc_provider': {
'handlers': ['debug_console', ],
'level': 'DEBUG',
},
'datatracker': {
'handlers': ['console', ],
'level': 'INFO',
},
'celery': {
'handlers': ['console'],
'level': 'INFO',
}
},
#
# No logger filters
Expand Down

0 comments on commit d2623de

Please sign in to comment.