Thank you! Your feedback has been delivered
Thank you! Your feedback has been sent

Alert and log- db, general errors and exceptions on Heroku with rails

Hello all, Rails 3.2, ruby 1.9.3 on heroku

i'm having too many problems that go unlogged/un notified, and worse- redirected to heroku's 500 page.

my latest problem, just an example - we've reached our DB limit and nothing was saved for 12 hours (!!)

so my question is- please supply the best "RAILSY" way to catch and handle (while logging the exceptions for later investigation) including, but not limited to: 1. code errors - nil, wrong params, etc 2. routing 3. db errors, problems with saving records that were already validated, but didn't save properly nevertheless.

i've already installed papertrail and newrelic for enhanced monitoring, but i would love a "catch all" and robust solution

looking forward to your solution!

User Gravatar


Posted Dec 29 2013 13:52 UTC


  • Assigned To elado
  • Solved
  • rails

5 Replies

Airbrake ( is a great service to get notified about all of your Rails errors. You'll get an immediate email on exceptions in your app.

An open source project alternative that you'll have to install on your own is Errbit (

User Gravatar


Posted Dec 29 2013 23:43 UTC


This didn't solve your task? Get your own custom solution.


To debug and get alerted in real time on errors, exception and anything else by email, or other hooks you can use

its free and works great with heroku to catch any errors including local variables, request information, session and cookie, etc

also it seems odd that you reached heroku db limit, since the free tier is 10,000 rows, and if you said nothing is saved I dont think that you really reached that limit

write heroku pg:info to see the db info and see the number of the rows

User Gravatar


Posted Dec 30 2013 10:44 UTC

hi elad, thank you. i knew about airbrake, but it's my first with errbit. nice!

will it work on a heroku instance or should i set up it's own virtual server? if it will, i will mark it as the correct, although i was hoping for some kind of a cross site solution from within the code, much like and more of this kind.

in conclusion - i guess that for monitoring and logging it's better to hold a secondary, stand-alone server that is always up and monitoring. would love to know if it works properly on heroku to mark as correct

User Gravatar


Posted Dec 30 2013 11:16 UTC

@guyisra, thank you. never heard of this.

will check it out, but just so you know, the problem was undoubtedly the free tier - we've reached max lines, and it wouldn't save any more.

User Gravatar


Posted Dec 30 2013 11:19 UTC

Exactly, you need a server that is always up, so in case of a failure with any of your resources (databases, network or even hardware failures) you'll be notified by the other server. I'd also combine it with a service like Pingdom that will test your site and notify you for broken things/when the app is down.

I'd definitely go with Airbrake since it's better to focus on your app (and pay the $39/m) then on maintenance. This is probably the reason you chose Heroku over AWS.

User Gravatar


Posted Dec 30 2013 11:23 UTC

Add a reply

By posting a reply on CodersClan you agree to our Terms & Conditions