开发者

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

I wanted to hav开发者_开发问答e 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 :)


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜