Log HTTP Requests with Django and Gunicorn
To get request logging enabled on Gunicorn you have to add a logger to the logging section in your settings.py:
'gunicorn.access' : {
'level': 'DEBUG',
'handlers': ['console'],
'propagate':False
}
and start up the Gunicorn server:
gunicorn -c config.py utrade.wsgi:application \
--log-level=debug \
--timeout=0 \
--access-logfile=-\
--log-file=-
You should see the incoming requests in your terminal:
INFO:django.server:"GET / HTTP/1.1" 201 0