I've just started working on a brownfield ASP.NET 2.0 Web Application. As with a lot of brownfield applications, the architecture, and specifically the exception logging architecture, is inconsistent and in some places, missing or incorrect (swallowing exceptions, re-throwing, using them for control logic etc)
As a starting point for bringing all of this under control, I'd like to just do a blanket catch all of EVERY exception being thrown in the application, and log it away somewhere like a DB table. Unfortunately to explicity code that into the app would be many days and probably weeks of work, so that rules out hand coding things (eg. putting logger.log(ex) everywhere) and things like log4net and nlog. What I'm looking for another, more light-weight solution to the problem.
After some quick reading on here, I've come across various techniques like:
What have people's experiences been with these solutions? Bearing in mind that I'd like to implement this as simply and painlessly as possible, so bells and whistles aren't required at this stage. All I need is something that will report every exception to a single location so I can start finding holes in the logic.
EDIT:
I should probably make it clear that I want to log ****ALL**** exceptions (even the ones that are handled, as some are handled incorrectly). Is it possible to configure Elmah to do this? If not, what are my other options?
I thoroughly recommend elmah to plugin into your application. Its an eye opener to find out where things are going wrong. I've had several unreported time-outs in my application for example that I have identified and fixed.
As for simple and painless. It involves no changes to your code other than some extra lines to your web.config. You can add it and be viewing exceptions within 10 minutes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With