Heroku and PhpStorm: view production logs inside the IDE

Luís Nóbrega
2 min readOct 5, 2018

--

Image of Logs (from trev.pix)

In this article I will share with you a simple way of viewing logs of a Heroku dyno, without leaving PhpStorm.

First, how to see real-time logs of our dyno? We need to run the following command:

heroku logs --tail

Regard that this is only one of the available possibilities. In the official documentation that addresses logging you have several examples.

Next I’ve created a bash script executable file in the path: bin/logs/prod.sh. To make this file executable just run:

chmod +x bin/logs/prod.sh

Now, in PhpStorm, right-click in the file, and choose Run.

PhpStorm: option “Run”.

What will happen is that the bash will be executed, showing all the logs in a specific window, inside the IDE.

PhpStorm: Window with “Run” execution.

What did you think?

Did you find this way of seeing logs inside the IDE practical? Leave me your opinion, with a comment. I would like to know.

--

--

Luís Nóbrega
Luís Nóbrega

Written by Luís Nóbrega

Web Developer at 25friday. Likes to travel, write and being a father.

No responses yet