【发布时间】:2014-07-09 12:56:19
【问题描述】:
我有一个使用 this tutorial 设置的小型 Python Web 应用程序。一切似乎都运行顺利,但是当程序崩溃或遇到错误时,我没有收到回溯或错误消息。我正在使用
heroku logs --tail
实时查看服务器日志。
例如,我用这段代码引入了“列表索引超出范围”错误:
thing = [1, 2, 3]
print thing[4]
我肯定会点击该代码,因为我在前一行将消息记录到控制台。但是在 Heroku 日志中,我看到了我的日志消息,然后什么也没有。没有错误或失败的迹象。如何查看我的日志?我应该在不同的地方寻找吗?
如果我在 Python 2.7.6 交互式解释器中运行相同的代码,我会得到:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: list index out of range
【问题讨论】:
标签: heroku flask gunicorn error-logging