如何在 Heroku 上获取应用程序错误的日志

How to get logs for Application Error on Heroku

我一直在尝试重新部署我在 Heroku 上托管的应用程序。

在每次重新部署时我都得到 "Your app was successfully deployed."

但是在打开页面时我得到:

An error occurred in the application and your page could not be served.
Please try again in a few moments.
If you are the application owner, check your logs for details.

在 'Activity' 标签下打开日志时给了我日志,但它没有说明哪里出了问题。

如何知道导致应用程序错误的原因。

我们可以从 heroku shell 轻松获取 Heroku 的日志。要在您的计算机上获取 'heroku shell',请安装 heroku toolbelt。

安装一个,从'cmd'登录到heroku:

heroku login

然后你可以得到日志:

heroku logs --app APPNAME

无论您使用 git、github 还是 dropbox,这都有效。