Flask app.logger messages missing from Gunicorn error logs
0 reputation · 15 Jan 2023, 05:23 UTC
Confirm whether warnings emitted through app.logger.warning inside a Flask route appear in Gunicorn error output when no application logging handlers are explicitly configured.
Flask's app.logger is a standard logging.Logger and does not automatically attach handlers or propagate to the root logger. Under Gunicorn or uWSGI, visibility depends on the WSGI server's logging setup and the installed Flask release. The development server is not a production reference.
Does app.logger propagate to Gunicorn's root logger by default in Flask 2.x and 3.x? Must route-level warnings use an explicit handler to reach Gunicorn error output? Should propagation be disabled to avoid duplicate entries?