Logging Errors with ELMAH in ASP.NET MVC 3 – Part 2 – (Notifications)

Tags: Elmah, ASP.NET, MVC, Logging, Error Handler

Setup Notifications for ELMAH Errors

Now that ELMAH is setup, you need a way to be notified when an error occurs. Though you can just subscribe to your ELMAH RSS feed at /elmah.axd/rss, I prefer to receive an email notification as soon as an error happens. To do this simply merge the following changes into your web.config's <configuration> section.

    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />

    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />

  <errorMail from="e@mail.address"
             subject="elmah error mail" />

There's a lot more configurability, but those are the basics. Here's a good article showing more options. Also if you haven't already done it, set your smtp settings too...

      <network host="localhost" />

Next Step: Logging Errors with ELMAH in ASP.NET MVC 3 – Part 3 – (Filtering) »

This Post is Part of a Multi-Part Series

Add a Comment