How to get complete production.log from a rails app in heroku? How to get complete production.log from a rails app in heroku? heroku heroku

How to get complete production.log from a rails app in heroku?


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.


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


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