mmdgz
mmdgz

Reputation: 13

How to configure Celery loglevel in Supervisord

I configured celery-worker and celery-beat with supervisord, and both work well except some small issues in logging.

Here is the celery-worker.conf, where I specified the loglevel to WARNING

[program:celery-worker]
command=celery -A apps.crawler.celery:app worker --loglevel=WARNING
directory=/home/django/django_project/django_project
user=django
numprocs=1
stdout_logfile=/home/django/django_project/django_project/logs/celery-worker.log
stderr_logfile=/home/django/django_project/django_project/logs/celery-worker.log
autostart=true
autorestart=true
startsecs=10

; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 10

; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true

However, the celery-worker is always started with loglevel=INFO

ps -ef |grep celery-worker
django    2422  6909  0 01:13 ?        00:00:03 /usr/bin/python /usr/local/bin/celery -A apps.crawler.celer :app worker --concurrency=1 --loglevel=INFO
django    2427  2422 10 01:13 ?        00:03:04 /usr/bin/python /usr/local/bin/celery -A apps.crawler.celer :app worker --concurrency=1 --loglevel=INFO

How can I change the loglevel to WARNING?

Upvotes: 0

Views: 1009

Answers (1)

Gary Gauh
Gary Gauh

Reputation: 5125

I had the same problem and solved it by restarting supervisord. Supervisord needs to be restarted before the new config taking effect.

Upvotes: 1

Related Questions