How to let Gunicorn log to console (stdout and stderr)¶
In a cloud app, it's better to:
- output information logs to stdout
- output error logs to stderr
This article will tell you how to make Gunicorn do this.
Update command line arguments¶
gunicorn --access-logfile '-' --error-logfile '-' app:app
Update config file¶
If you prefer to use the config file, try this:
gunicorn -c config.py app:app
The file config.py
should contain:
accesslog = '-'
errorlog = '-'
This article is originally created by tooli.top. Please indicate the source when reprinting : https://www.tooli.top/posts/gunicorn_stdout
Posted on 2023-03-08
Mail to author