Log and Alert on Heroku Routing Errors

Most application errors can be sent to a third-party error service such as Sentry.

On Heroku, routing errors never reach these services because they don't occur in the application's processes, they occur in Heroku's routing layer.

To observe and alert on these errors, send them to a logging service such as Papertrail.

Heroku Routing Errors

You may have seen Heroku Platform Error Codes in your logs:

These can be caused by many different factors ranging from misconfigured web server concurrency to slow clients (mobile phones on weak cell connections).

Before we can tune our app, we need to first know these errors are occurring.

The bad news is we can't use our usual error tracking systems. The good news is that Heroku reliably includes the text status=503 in the logs for these errors.


Papertrail is a logger with a Heroku add-on. Add and open it:

heroku addons:add papertrail
heroku addons:open papertrail


Going forward, you'll receive alerts for any Heroku routing errors in your project's Slack channel.

Each log entry has a request_id that you can copy and paste into Papertrail to see the contextual requests before and after the 503.