Q:

Python Celery - Worker ignoring loglevel INFO

I'm using the following command:

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

But DEBUG logs are still pouring out, same goes for when using -l warning and --logfile

Any idea why Celery would ignore the log setting?

Further details:
the logs come from the Python library suds which outputs to the logger using DEBUG.

A:

I had the same problem and I decide to to adjust loglevel inside settings.py:
LOGGING['loggers']['celery'] = {
                               'handlers': ['console', <etc>],
                               'level': <LEVEL_YOU_WANT>,
                               'propagate': True,
                              }

Also I decide 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,
                              }

Doing so will let you see only logs from you tasks, and not Celery's "machinery".

