PHP Error Logs in Heroku

nick picture nick · Dec 8, 2012 · Viewed 7.8k times · Source

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.

Answer

bonez picture bonez · Dec 13, 2012

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.