Devops

How to tail -f Ruby on Rails application logs on heroku server

This minipost contains the command to real-time tail -f your production application logs on a Heroku server.

We assume that you have already set up the Heroku toolbelt and you are already logged in to your Heroku account by:

heroku login

(inside the project directory appname)

To tail your heroku production logs navigate to the application directory:

cd appname

and execute:

heroku logs --tail 

or

heroku logs --t

The above command will display a real-time tail of the recent production logs and will leave the session open for any new real-time logs to stream in.

If you have multiple heroku origins for the same application you might need to specify the name of the application by:

heroku logs --tail --app appname

(Where appname, the application name on the heroku platform)

You will now be able to see your application logs in your console. When you are done, simply press Ctrl+C to return to the prompt. A real-time tail session is automatically terminated after one hour of inactivity on Heroku platform.

Buy Me A Coffee

Read also the following