【问题标题】:Where do my Python prints got with Flask deployed under nginx with uWSGI?使用 uWSGI 在 nginx 下部署 Flask 时,我的 Python 打印在哪里?
【发布时间】:2016-01-27 07:06:52
【问题描述】:

this tutorial 之后,我刚刚设置nginxuWSGI 来服务我在Flask 中构建的网站,现在一切正常。

我有时想调试一些我通常在代码中使用基本print 语句的东西。不幸的是,我不知道这些打印的结果去哪里了?

我已经跟踪了以下日志文​​件,但我没有在其中看到打印内容:

/var/log/uwsgi/emperor.log
/var/log/uwsgi/myapp_uwsgi.log
/var/log/nginx/access.log
/var/log/nginx/error.log

有人知道我在哪里可以看到打印结果吗?

【问题讨论】:

标签: python linux nginx flask uwsgi


【解决方案1】:

标准输出和 Nginx 仅记录标准错误。

你应该改用flask的app.logger模块。 看看the flask documentation on error handling

【讨论】:

  • 我知道我必须在某个时候实现日志记录,我想那一刻已经到来。谢谢!
猜你喜欢
  • 2023-02-09
  • 1970-01-01
  • 2015-10-12
  • 2014-06-04
  • 1970-01-01
  • 2022-12-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多