Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep log tail alive on Heroku using ssh?

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.

like image 919
B Seven Avatar asked Jul 21 '11 16:07

B Seven


2 Answers

Have you done all of this:

$ heroku config:add LOG_LEVEL=DEBUG
$ heroku addons:upgrade logging:expanded
$ heroku logs --tail
like image 96
thenengah Avatar answered Sep 19 '22 08:09

thenengah


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/

like image 21
B Seven Avatar answered Sep 21 '22 08:09

B Seven