Skip to content

Web Development

Web Servers / WSGI



How do I include access logs?

By default, Gunicorn won't output anything but the log statements from within the application (and of those, only the ones matching the particular log level). In a regular setup, your access logs will be sitting in an access_log file, maintained by Apache or nginx. If you want to output those in the standard log output of Gunicorn too (stdout by default), you should explicitly configure Gunicorn to do so:1

gunicorn \
 --bind \
 --workers 4 \
 --access-logformat '%(t)s %(p)s %(h)s %(m)s %(U)s %(s)s - %(L)ss' \
 --access-logfile - \

NOTE: Make sure that you are also usign the right output. In my example, --access-logfile - means, use stdout