使用 uWSGI 在 nginx 下部署的 Flask 在哪里获取我的 Python 打印件?
Where do my Python prints got with Flask deployed under nginx with uWSGI?
关注 this tutorial I've just setup nginx with uWSGI to serve my website which I built in Flask,目前一切正常。
有时我想调试一些我通常在代码中使用基本 print
语句的东西。不幸的是,我不知道这些印刷品的结果在哪里?
我跟踪了以下日志文件,但我没有在其中看到印刷品:
/var/log/uwsgi/emperor.log
/var/log/uwsgi/myapp_uwsgi.log
/var/log/nginx/access.log
/var/log/nginx/error.log
有人知道我在哪里可以看到打印结果吗?
正常打印在 stdout 上进行,Nginx 仅记录 stderr。
您应该改用 flask 的 app.logger 模块。
看看the flask documentation on error handling
关注 this tutorial I've just setup nginx with uWSGI to serve my website which I built in Flask,目前一切正常。
有时我想调试一些我通常在代码中使用基本 print
语句的东西。不幸的是,我不知道这些印刷品的结果在哪里?
我跟踪了以下日志文件,但我没有在其中看到印刷品:
/var/log/uwsgi/emperor.log
/var/log/uwsgi/myapp_uwsgi.log
/var/log/nginx/access.log
/var/log/nginx/error.log
有人知道我在哪里可以看到打印结果吗?
正常打印在 stdout 上进行,Nginx 仅记录 stderr。
您应该改用 flask 的 app.logger 模块。 看看the flask documentation on error handling