DEV Community

AutoIdle
AutoIdle

Posted on • Originally published at Medium on

2 1

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.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay