Heroku: How can you check Heroku Error Logs?

半城伤御伤魂 提交于 2019-12-03 05:23:37

问题


I've got a PHP application on a free Heroku account. Today for no apparent reason I got Heroku's Application Error screen for about an hour. No downtimes on Heroku's status report page.

I'd like to check the logs to figure out why the application was down.. But have no idea how to do this! Can somebody please help me?


回答1:


Simply use heroku logs to display the last 100 lines of your logs.

Or to tail the logs in real-time: heroku logs -t

Heroku only saves the last 1500 lines of logs, which you can access using heroku logs -n 1500. If you want more logging, check out Heroku add-ons like Logentries or Papertrail.




回答2:


$ heroku logs -t --app app-name

This gives you all current logs (logentries add-on would be used)




回答3:


heroku logs --tail

With above command you can see continuous heroku logging.




回答4:


for checking all the logs in heroku console

config.logger = Logger.new(STDOUT) config.logger.level = Logger::DEBUG

put these two lines inside the environment on which you are running your heroku app(e.g. production.rb)

after that check logs here: heroku logs -t You can check detail logs there also errors too if any.



来源:https://stackoverflow.com/questions/21305049/heroku-how-can-you-check-heroku-error-logs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!