3

I wanted to have a detailed look into my production.log, but heroku doesn't seem to store them. Does anyone else, have a solution for that problem. It would be nice to get it stored safely away. thanks in advance :)

tabaluga
  • 1,377
  • 4
  • 20
  • 27

3 Answers3

3

The Heroku logging article shows you can read up to 1500 lines of your log file. By default, heroku logs shows the last 100 lines.

heroku logs -n 1500

Note that Heroku logging uses Logplex that merges logs from your app as well as from Heroku system. You can filter out logs produced by the system

heroku logs -n 1500 --source app
MichaelZ
  • 1,890
  • 2
  • 13
  • 8
3

From the Heroku documentation you can see that their logging facility is limited to the last 100 lines whenever you read them back from the console.

If you have a requirement to keep and analyze all of your production logs then it looks like you will have to consider archiving them off-Heroku to, say, S3 or through EC2 logging server.

Neal
  • 4,468
  • 36
  • 33
bjg
  • 7,457
  • 1
  • 25
  • 21
  • 1
    hmmm, okay...but how can I accomplish that? – tabaluga Jul 14 '10 at 11:32
  • 1
    oh, I just found it http://stackoverflow.com/questions/2671454/heroku-how-to-see-all-the-logs thanks bjg for pointing me in the right direction – tabaluga Jul 14 '10 at 11:34
  • Just for completeness you can see more than 100 lines with heroku logs --tail It's not what the OP was asking about, this is just in relation to "limited to the last 100 lines" – GreenAsJade Oct 16 '12 at 09:21
2

This will work in heroku, execute this from your terminal:

heroku logs -n 200

or

heroku logs -t --app <app_name> > any_file_name

Here the max -n limit is 1500

Community
  • 1
  • 1