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.

A beginning

March 16th, 2006

All good things must start somewhere, and this is as good a place as any. My name is Tom Davies and I am starting this blog to share with you my thoughts on things ranging from software development to current projects that I am working on.

The first thing I would like to share is a website I developed called the GiftHat.com.

The Gift Hat is a site for storing and sharing your wishlists with your friends and family. I am currently seeking beta testers so if you have a few moments and would like to participate, please sign up.

The Gift Hat was developed using RubyOnRails. In future posts, I will expand on some of the technologies and techniques I used to develop the Gift Hat.