PHP错误日志在Heroku中 [英] PHP Error Logs in Heroku

查看:149
本文介绍了PHP错误日志在Heroku中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Heroku上部署了一个PHP应用程序,但似乎找不到apache错误日志。使用命令 $ heroku logs 我似乎只获取了apache访问日志。所以一堆GET 200 OK等,但没有错误信息放入错误日志本地,如'PHP致命错误:等等''

我在哪里可以访问Heroku上的这些错误日志,或者如何让应用程序像写入本地错误日志那样写入Heroku的日志?



I感觉就像我忽略了一些明显的东西,但我似乎无法找到解决方案。

解决方案

经过大量实验后,看起来您需要在php.ini
中注释 error_log 并确保 log_errors = on 。 。这应该将你的错误输出到stderr,heroku logplex可以接收流,然后使用 heroku logs --tail 进行监控。我启动了一个heroku facebook应用,他们的phpinfo()并复制设置。

I have a PHP app deployed on Heroku, but I can't seem to locate the apache error log. Using the command $heroku logs I seem to get only the apache access logs. So a bunch of GET 200 OK etc, but no error information that is put into the error log locally, such as 'PHP Fatal error: blah blah'

Where do I access these error logs on Heroku, or how do I tell the app to write to Heroku's log like it does the local error log?

I feel like I'm overlooking something obvious but I can't seem to find a solution.

解决方案

After a lot of experimentation, it looks like you need to comment out error_log in php.ini and make sure log_errors = on .. this should output your errors to stderr where the heroku logplex can pick up the stream, then monitor with heroku logs --tail .. I launched a heroku facebook app and looked at their phpinfo() and copied the setup.

这篇关于PHP错误日志在Heroku中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆