feat: config celery logging via Django (#7371)

* feat: config celery logger via Django

* feat: Disable celery's logging config
This commit is contained in:
Jennifer Richards 2024-04-26 17:00:51 -03:00 committed by Nicolas Giard
parent 8f87573144
commit d2623de615
2 changed files with 17 additions and 7 deletions

View file

@ -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.

View file

@ -252,17 +252,21 @@ LOGGING = {
'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