I'm trying to trap errors in my ASP.net web app.
I started here http://support.microsoft.com/kb/306355
The article suggests at least three ways of trapping and handling errors
I want to write userID, page that caused error and Error message to the database and maybe generate an email to myself of the error( let's not worry about the last bit yet). I am using Visual Studios 2008 .
Keeping in mind the latest ASP.Net security issue I think I want to use option 3.
My question is when would I write error details to the database?
Is it in Application_Error? will Application_Error fire even though I'm using <customErrors> in web.config
Or do I write to the dB in the code-behind of the default error page?
What are best practices for this?