How to keep log tail alive on Heroku using ssh?

2019-03-28 09:43发布

Using heroku logs --tail which works great for a few minutes. Then it stops displaying the logs. It seems that the ssh connection is timing out and dying. There is no error or message. Working in Ubuntu 11.04 on wired conneciton.

I added the following to ~/.ssh/config:

ServerAliveInterval 5

But it didn't work. Do I need anything else in the config file? How do I know if it is doing anything? How can I monitor the traffic and see the keepalive request? I am looking at System Monitor but don't see anything every 5 seconds.

Thanks.

3条回答
混吃等死
2楼-- · 2019-03-28 09:49

Have you done all of this:

$ heroku config:add LOG_LEVEL=DEBUG
$ heroku addons:upgrade logging:expanded
$ heroku logs --tail
查看更多
forever°为你锁心
3楼-- · 2019-03-28 09:53

I have seen the same issue. I'm not certain that it is ssh that times out but something does. For now, we've placed our monitor in a loop so it resumes automatically in case of time-out.

We also use PaperTrail, however it has limits in the amount that you can transfer. We use PaperTrail for general purpose use, and tail the logs for the excrutiating-detail logs that quickly use up all avaiable PaperTrail capacity.

查看更多
▲ chillily
4楼-- · 2019-03-28 09:57

It turns out that I was looking for an answer to the wrong question. Why use the tail to save logs? It is problematic, labor intensive, and error prone.

The solution I found was Papertrail. Small sites are free. papertrailapp.com.

Here's the complete story from my blog: http://www.onlineinvestingai.com/blog/2011/08/07/better-logging-with-papertrail-on-heroku/

查看更多
登录 后发表回答