Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku - how to see all the logs

Tags:

logging

heroku

I have a small app on heroku. Whenever I want to see the logs I go to the command line and do

heroku logs 

That only shows me about 100 lines. Is there not a way to see complete logs for our application on heroku?

like image 840
josh Avatar asked Apr 19 '10 22:04

josh


People also ask

How do I check application logs?

Click on the Windows Start Button. Right-click on Computer and select Manage. In the Computer Management dialog, expand System Tools | Event Viewer | Windows Logs. Select Application Log.

How do I read heroku errors?

Simply use heroku logs to display the last 100 lines of your logs. 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. Save this answer.

How do you delete heroku logs?

Currently, there is no way to clear the Heroku logs. Heroku maintains a record of the past 1500 lines of log activity.


2 Answers

Update (thanks to dawmail333):

heroku logs -n 1500 

or, to tail the logs live

heroku logs -t  

Heroku log documentation

If you need more than a few thousand lines you can Use heroku's Syslog Drains

Alternatively (old method):

$ heroku run rails c File.open('log/production.log', 'r').each_line { |line| puts line } 
like image 89
glebm Avatar answered Sep 27 '22 18:09

glebm


Logging has greatly improved in heroku!

$ heroku logs -n 500 

Better!

$ heroku logs --tail 

references: http://devcenter.heroku.com/articles/logging

UPDATED

These are no longer add-ons, but part of the default functionality :)

like image 34
2 revs Avatar answered Sep 27 '22 20:09

2 revs