When working in a web environment, it can be difficult to know the health of your application without digging through some log files or worse, waiting for the customer to complain.

Ruby On Rails provides a nice and easy alternative for emailing you whenever an error occurs within your application.

And best of all, it is a plugin called exception_notification, which requires very little effort to roll into your application. To install the exception_notification plugin, just type the following from the root of your rails app:

> ruby script\plugin install exception_notification

And then any controller that you want to notify you of errors needs to include ExceptionNotifiable. In my case, I would like to be notified for all controllers, so I added this into my application controller:

[ruby]class ApplicationController < ActionController::Base
include ExceptionNotifiable[/ruby]

Then, you just need to configure the email address to send the error notifications in your config\environment.rb file:

[ruby]ExceptionNotifier.exception_recipients =
%w(some-admin@email.com another-admin@email.com)[/ruby]

And that's it!

Note: One prerequisite to doing all of this is you must also configure your ActionMailer for sending emails.