DEV Community

AutoIdle
AutoIdle

Posted on • Originally published at Medium on

Logging with Laravel on Heroku

Laravel on Heroku — Tip #5

Photo by Markus Spiske on Unsplash

Laravel by default will log errors and messages into a directory on disk, which isn’t ideal, because Heroku uses an ephemeral filesystem, that means that any changes to the filesystem whilst the dyno is running only last until that dyno is shut down or restarted. Each dyno boots with a clean copy of the filesystem from the most recent deploy. This is similar to how many container-based systems, such as Docker, operate.

Change the log destination on Heroku:

heroku config:set LOG\_CHANNEL=errorlog
Enter fullscreen mode Exit fullscreen mode

Now you can tail the logs live:

heroku logs -t
Enter fullscreen mode Exit fullscreen mode

That’s it. 🚀

Want more tips like these?

You should follow me on Twitter! And if you’re building on Heroku, you should check out AutoIdle — the automated way to save money on your staging and review apps.

Top comments (0)