SoftwareSavant
SoftwareSavant

Reputation: 9737

Automatically Send an Email when Exception is raised in asp.net MVC2

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.

Upvotes: 0

Views: 800

Answers (2)

Franze Caminha
Franze Caminha

Reputation: 141

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

Upvotes: 0

dbones
dbones

Reputation: 4504

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

Upvotes: 1

Related Questions