I’m a bit of a dabbler when it comes to ASP.NET controls/features. I’ve given most of them a go if not used them in production but just when I’m thinking I should move over to ASP.NET 3.5 (hangs his head in shame) I find a 2.0 feature that slipped under my radar; Health Monitoring.
Health Monitoring is a framework to log and report events during the life of an ASP.NET application. Events can be logged to a sql database, emailed out, written to the windows event log etc. Events that are logged include application lifetime events, audits, errors, authentication related events. There’s scope for you to extend these events to create custom events for logging. It’s been around for a while and so there are plenty of articles around to help you (and me) get going. Here’s a MSDN article on How to use Health Monitoring in ASP.NET 2.0 and an essential FAQ on Health Monitoring by Erik Reitan.
Health Monitoring is supported beyond ASP.NET 2.0 and here is another MSDN article on support for it in ASP.NET 3.0+. And yes, the same can be done with other logging frameworks including, but not limited to: log4 net, ELMAH (Error Logging Modules and Handlers) and Logging Application Block (Microsoft Enterprise Library).