MaZZly
MaZZly

Reputation: 124

Gunicorn loggin with django outputs "[DEBUG] 2 workers" every second

Got an interesting problem I can't seem to solve or find any answers to..

Gunicorn process is started by supervisor with:

gunicorn django_app:application --name django --workers 2 --log-level=debug --bind=127.0.0.1:8003

Application runs fine and the logfile logs as it should.. but also gets a log every seconds stating the number of workers running:

[2015-12-04 07:28:38 +0000] [5168] [DEBUG] 2 workers
[2015-12-04 07:28:39 +0000] [5168] [DEBUG] 2 workers
[2015-12-04 07:28:40 +0000] [5168] [DEBUG] 2 workers
[2015-12-04 07:28:41 +0000] [5168] [DEBUG] 2 workers
[2015-12-04 07:28:42 +0000] [5168] [DEBUG] 2 workers
[2015-12-04 07:28:43 +0000] [5168] [DEBUG] 2 workers
[2015-12-04 07:28:44 +0000] [5168] [DEBUG] 2 workers
[2015-12-04 07:28:45 +0000] [5168] [DEBUG] 2 workers
[2015-12-04 07:28:46 +0000] [5168] [DEBUG] 2 workers
[2015-12-04 07:28:47 +0000] [5168] [DEBUG] 2 workers

This makes debugging a royal pain and I'd like to get the logger to stop logging those messages.. any ideas?

Upvotes: 2

Views: 121

Answers (1)

Tomasz Jakub Rup
Tomasz Jakub Rup

Reputation: 10680

Make Your own Logger class which inherit from gunicorn.glogging.Logger. Overwrite debug function. In this function reject this kind of message.

And finally run gunicorn --logger-class MyLoggerClass .....

Upvotes: 1

Related Questions