ELMAH: Only sending specific exception type via mail

Posted by Sir Code-A-Lot on Stack Overflow See other posts from Stack Overflow or by Sir Code-A-Lot
Published on 2010-05-31T08:34:08Z Indexed on 2010/05/31 9:42 UTC
Read the original article Hit count: 297

Filed under:
|
|

Hi,

I have ELMAH set up for a webapp, logging exceptions to a SQL server.

I wish to have ELMAH send me an email too, but only when a specific exception is thrown (ie. MySpecialException).

ELMAH must still log all exceptions to SQL server.

I know you can do it programmatically in global.asax, but I'd prefer to use web.config.

So, how do I restrict ELMAH error mails to filter out everything but a specific exception type, using web.config?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET