When email notification is not working in ELMAH

Hopefully you've heard of ELMAH, (Error Logging Modules and Handlers) if you're doing ASP.NET work. This gem is priceless when trying to catch unhandled exceptions in your project.

I ran into an issue today when following the web.config guidelines in the elmah release (it contains a sample web.config with documentation for all the configuration).  I wanted to be emailed whenever an exception occurred on the site, so I put the appropriate settings into the errorMail element in the <elmah /> configuration.  I setup some test exceptions to make sure that ELMAH was working correctly, and could see the errors in elmah.axd, but the emails were not being sent.

It turns out that the modules registered under <system.webServer> <modules> need to be included in <system.web> <httpModules> as well:

<system.web>
<httpModules>
    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"  />
</httpModules>
</system.web>

The example web.config mentions having to put these modules in additional modules in httpModules if mail reporting is desired, but since it was commented out in the example, I accidentally skipped over it.  After this change was made, the email notifications started coming through.  Hopefully this will help me remember in the future, or help someone who is having the same issue.


Posted by: Jeff
Posted on: 1/16/2010 at 12:13 AM
Categories: elmah
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (2) | Post RSSRSS comment feed

Comments

phones ringtones Canada

Friday, April 02, 2010 2:31 PM

phones ringtones

Your great release should be favorite as the bollywood ringtones from the mp3 ringtones company are.

Rapidshare United States

Wednesday, April 28, 2010 10:51 AM

Rapidshare

I\'m happy I found this blog, I couldnt discover any info on this subject matter prior to. I also run a site and if you want to ever serious in a little bit of guest writing for me if possible feel free to let me know, i\'m always look for people to check out my site. Please stop by and leave a comment sometime!

Add comment




  Country flag

biuquote
  • Comment
  • Preview
Loading