There has been an explosion of late on new ways to deal with tracking exceptions thrown in a production Rails app. It used to be that you put in exception_notifier and went about your business. But not too long ago I decided that I needed more. Two things started this push:
- There was more than just me working on a project. Several people needed easy access to the exceptions (at times) but I didn’t want to clutter their inboxes with e-mails for every exception.
- I would not be working on the project forever and others would be handling long term maintenance. This meant changing the e-mail addresses in the config file quite often and just felt like ‘the wrong way’ to be doing it.
So I started looking for other alternatives. Here’s an overview of the three I found:
Let’s start with the positive. Exception logger is exactly what I was looking for. It provides the functionality I was looking for and makes tracking exceptions with multiple users easy. Unfortunately, the install procedure is a mess. The standard plugin just would not work for me. Rails is notoriously bad at handling controllers/models/views that are inside a plugin so exception logger really needs to be built on Engines for that kind of functionality. Instead, it uses a number of hacks to try and get Rails to recognize the code in the plugin and it just doesn’t work well. Plus, in order to get added functionality (such as authentication) into the controller, you’re supposed to use a config file! It’s a crazy unclean mess. So in order to get it operating, I was forced to simply take the controller, views, etc and put them into the normal app tree. This took a lot of setup and debugging, but I was able to get it to running and now it works extremely well. I have it in one high-use production app and I’m very happy but I don’t expect to use it much more. You lose the ability to e-mail notifications (at least not without hacking some more of the plugin) as well, so it’s only good in a few select cases.
Now we start getting to the fun stuff. Several new exception monitoring applications have sprung up recently and I decided to check them out. Exceptional is a hosted service and although I’d really prefer to have my exceptions tracked locally on a per-app basis, having them aggregated does have its benefits. It’s totally free, so sign up for a username, then create a new app profile to get an api key. Install their plugin and paste in the key and you’re set. It runs in production mode and sends the exceptions off to their logging service. It integrates with lighthouse, campfire, and twitter (none of which I use, but I’m sure it helps others) and will also e-mail you the notifications.
Once again, though, some issues made it unusable. It appeared to work great, but as I started doing some system administration, I started running into a number of problems. Whenever the plugin loads (when in production mode) it dumps a set of debug messages to stdout. Every time time I’d load a production console (for working on a few issues that could only be tested on the production/staging server) I’d get messages about its attempt to connect. Then a few seconds later, interrupting whatever I started, there would be more messages about the successful connection. Unfortunately it does this when running rake tasks as well, so all my cron jobs that use rake tasks were now littered with these messages. I was prepared to just edit the plugin to stop these messages, but instead I came across our next entry.
Hoptoad is very simple, free, and nearly identical to Exceptional. Sign up (you get your own subdomain), add an app profile, install the plugin, and copy the api key. It doesn’t have the extra integrations of exceptional (though I’ll bet they’re coming), but it does everything I need and without the annoying messages. It also lets you give extra users access to errors from certain apps only (as does Exceptional, although it wasn’t immediately obvious whereas Exceptional appears to be one username only). One thing I will really miss from Exceptional is that it tracked 404 errors as well. Although 404s usually come from scan bots, some may very well be legitimate broken links on or to your site, so it’s nice to track them.
Overall, I would highly recommend Exceptional and Hoptoad for everyone for all their exception tracking from now on. Which one you use just comes down to a matter of taste right now and maybe your specific requirements. I’m very excited to see what further features they add to differentiate themselves and I am REALLY hoping to see integration with scoutapp somehow, as I think exception handling and performance monitoring go hand-in-hand.
Finally, please feel free to comment on your own experiences with any of these projects!