Flask app logger not working when running within gunicorn

后端 未结 5 1180
臣服心动
臣服心动 2021-01-31 17:53

I\'m trying to save application log messages from a very simple flask app in a log file. While this works flawlessly when I\'m running the app with the embedded Flask server, it

5条回答
  •  滥情空心
    2021-01-31 18:20

    Flask uses Werkzeug for WSGI. The "Flask logs" you see are actually from Werkzeug's builtin development server and not from Flask itself.

    When you replace that development server with something like Gunicorn or uWSGI, you don't see its logs.

    The same goes for the Debugger. You can see the familiar "Flask debug page" even if you only use Werkzeug's Debugger.

    Now you know. :)

提交回复
热议问题