The problem is that you need data that is accessible only from the logs.
The best approach here would be to use syslog drain to send your logs to a service like Papertrailapp.com or Loggly - with these services you can configure your R14 error search, but then receive notifications - Papertrail supports hikes, messages, emails, etc. d. where you can handle the error.
We do this accurate publication of the process in the sinatra application, also hosted on Heroku, where we look at the heroku router log entries and queues = sizes or for too many errors, and then automatically scale our applications when demand is needed - because syslog is almost real of time, our applications, in fact, are aware of themselves.
source share