insilico - Web design and development
insilico - Software development and integration

Rails’ Exception Notifer Plugin in 5 Simple Steps

As a developer, I’m always looking tools which make my job easier (…and therefore more enjoyable!). And with Ruby on Rails, there’s a smorgasboard of tools and plugins available to us in the development community.

However, I’m relatively new to Ruby on Rails development (about 5 months and counting!) so I thought I’d give back to the RoR community by sharing some of what I’ve learnt so far.

Today; it’ll be about the Exception Notifer plugin. Exception Notifier sends email alerts to developers or support teams whenever an exception occurs within an RoR project. It took a while for me to get it implemented into the project, but it has been well worth it. It’s nice to be the first to know if your system breaks!

After taking a look at what I had to do to get this plugin up and running, I found it only takes 5 steps:

Step 1:

Install the plugin into your RoR Project

ruby script/plugins install exception_notification


Step 2:

Go to configenvironmentsdevelopment.rb and find this line:

config.action_controller.consider_all_requests_local = true

Change this value to false


Step 3:

Add the following two lines to the top of your appcontrollersapplication.rb

include ExceptionNotifiable

local_addresses.clear


Step 4:

At the bottom of your configenvironment.rb file, add the following:

ExceptionNotifier.exception_recipients = %w(your_address@email.com)

If you want to have more than one email recipient, seperate any subsequent email addresses with a single space.


Step 5 (Optional):

Edit the content of your alert emails by going to vendorpluginsexception_notificationviewsexception_notifierexception_notification.rhtml and making any changes you like.
You may want to add the build number or project name. It’s all a matter of personal preference really!

« Bargain Phones | TJ Communications »

© 2010 insilicoTM | Privacy Policy | admin@insilico.com.au | (08) 9200 4431 | Suite 33, First Floor, 133 Kewdale Road Kewdale WA 6105 | ABN 25 002 938 908