Piedon Celery - worker ignoring loglevel INFO

I use the following command:

celery worker -l info -A django_app - concurrency = 10 --autoreload

But DEBUG logs still spill over, just like using -l warning and --logfile

enter image description here


Any idea why celery is ignoring log settings?


Additional Information:

Logs come from the Python suds library, which is output to the logger using DEBUG.

+7
python django logging celery django-celery
source share
2 answers

I had the same problem and decided to configure loglevel inside settings.py :

 LOGGING['loggers']['celery'] = { 'handlers': ['console', <etc>], 'level': <LEVEL_YOU_WANT>, 'propagate': True, } 

I also decided to disable some "not interesting" logs:

 LOGGING['loggers']['celery.redirected'] = { 'handlers': ['console', <etc>], 'level': <LEVEL_YOU_WANT>, 'propagate': False, } for i in ['worker', 'concurrency', 'beat']: LOGGING['loggers']['celery.' + i] = { 'handlers': [], 'level': 'WARNING', 'propagate': True, } for i in ['job', 'consumer', 'mediator', 'control', 'bootsteps']: LOGGING['loggers']['celery.worker.' + i] = { 'handlers': [], 'level': 'WARNING', 'propagate': True, } 

This will allow you to see only the magazines from your tasks, and not "agriculture".

+5
source share

Try using the CELERYD_HIJACK_ROOT_LOGGER parameter :

 celery_instance = Celery('django_app') celery_instance.add_defaults({ 'CELERYD_HIJACK_ROOT_LOGGER': False, }) 
+1
source share

All Articles