views:

37

answers:

2

Where would I need to hook in (at what event) to be able send myself every 500 error that happens on my current ASP.NET project. Something inside the global.asax? And I'd like to send myself the output that the user would see. The white/yellow/black 500 standard ASP.NET error HTML.

My users only see the errors about 10% of the time. The other 90% these are Ajax responses.

+1  A: 

You can do this in global.asax.cs using Global Error Handling in ASP.Net using the Application_Error(...) method

Raj More
Use the Application_Error event to log/trace everything you want
sebastian
A: 

If you're more interested in the end result than in the process of making it work yourself, you might like to take a look at the Elmah ("Error Logging Modules and Handlers") project - http://code.google.com/p/elmah/

It's allows you to do many things with errors - send email notifications, log them to a database, browse the error log via a web interface, and even crazy things like an RSS feed of errors or using Twitter to tweet errors.

It's quite easy to install and configure.

Carson63000