0

I am trying to come up with a way to email a dev team when an exception occurs on a web page that I am developing. I heard of ELMAH, but I was hoping to use an internal Microsoft library to try and do that. I thought I saw an article online with a library, but I can't seem to find it (saw it last Friday and I can't seem to find it). If you could even point me to a tutorial of some kind, then I would appreciate it.

1
  • Downgrade? Was it that dumb a question? Nov 21, 2011 at 14:32

2 Answers 2

1

many logging frameworks are capable of sending an email on a logged exception.

MS wrote the Enterprise Library: use the email trace listener

Enterprise Library: Logging Block and Email

or you can use a 3rd party such as log4net : smtp appender http://logging.apache.org/log4net/release/config-examples.html

Elmah is not MS but here is a tutorial for that http://www.storm-consultancy.com/blog/development/tools-plugins/setup-email-alerts-from-elmah-when-exceptions-are-raised/

enjoy

2
  • Good comment. That being said, I have a dumb questions. Do I have to add a NEW listener? I already have a listener, but it doesn't have the correct DLL as deliniated in the stackoverflow post you showed me. Can I add another listener this time with the email logger? Nov 21, 2011 at 13:57
  • from my understanding you can multiple listeners configured. so it can log to a db, email and file. So either change your current listener or add the email one
    – dbones
    Nov 21, 2011 at 14:04
0

I don't see any problem using ELMAH, it is very stable.

Here is a good post to handle the error and send email: http://www.codecapers.com/post/Error-Handling-in-MVC-with-ELMAH.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.