Reputation: 3539
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?
Upvotes: 82
Views: 92528
Reputation: 265
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 are also errors too if any.
Upvotes: 1
Reputation: 121
Heroku is awesome but debugging applications on Heroku can be tedious. While technically all you need is $ Heroku logs --tail --app *and-your-app-name*
that might not always paint the whole picture.
There are limitations like the 1500 loglines size or the 1MB buffer allowed for the response that you need to consider. For the average Joe, this is plenty and most of us don't even worry about them.
But every now and then you run into one of those limitations or maybe you don't run in a limitation per se but you do have to sift through countless lines of logs to find that one little message.
This is where most developers will look for outside help. There are plenty of tools that will manage your logs without breaking the bank or if money is no issue, well, there are services for that scenario too.
The most popular ones would be:
Here's how a service like that would look like.
Upvotes: 4
Reputation: 4251
heroku logs --tail
With the above command, you can see continuous Heroku logging.
Upvotes: 18
Reputation: 670
$ heroku logs -t --app app-name
This gives you all current logs (logentries add-on would be used)
Upvotes: 38
Reputation: 1922
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.
Upvotes: 111