The Health Monitoring Module
If you want to know what's going on with your deployed web application, you'll need to implement some sort of instrumentation. Excellent tools such as log4net and Elmah let you record event information and capture unhandled exceptions but did you know that Asp.Net already includes an awesome Health Monitoring system that can do all this and more?
In fact, the Asp.Net Health Monitoring system is probably working right now to record Application Lifecycle Events, Exceptions and more into the Event Log of your web application server. You can check this out by opening the Application Log in your server's Event Viewer.
The great thing about the built-in Asp.Net Health Monitoring System is that you can add a few of lines to your application's web.config file and start having that information sent to you via Email or logged into a database. Here's the best part...If you're using the Asp.Net Membership stuff, you probably have the database table already (just look for a table called aspnet_WebEvent_Events.)
You'll love having all this information in a Sql Server database table because you already know how to get at it. Just fire up Sql Server Management Studio or whip out a quick reporting app and you'll be able to see things like Application Shutdown events, Unhandled Exceptions, Failed Login Attempts and more. To save you time, Dot Net Dash provides a User Interface and also methods that you can use in your own programs to do the following:
Get summary information
retrieves the total number of each web event and category of web events
Find web events
retrieves lists of web events matching search criteria
Retrieve web event details
retrieves the detail information for a specific web event
Delete web events
delete web events of a type or category and for a range of dates
The User Interface
The Health Monitoring Module is presented in a list-detail view that allows you to select Asp.Net web event records and view their details.
The Web Event List provides a drop-down Tree View that summarizes the various types of web events into categories defined by Microsoft. The number of web events for each category is displayed and when the category is selected, the list is filtered to show just that type of web event.
A search box, at the top of the list lets you enter a word or phrase that will be searched-for within the Detailscolumn of the web events database table. Be sure to first select a category to filter the list then enter a word or phrase then press Enter to retrieve a list of corresponding web events.
When you select a web event in the list, you'll see more detailed information including the ApplicationVirtualPath, MachineName, RequestUrl and Details. If you've entered a search keyword, you'll notice that it is highlighted in the Details.
At the top of the Health Monitoring Events list, you can click on the gears iconto get to the Delete web eventsfeature. This gives you an easy way to delete all web events or just those for a particular category. You can also choose to delete just the web events for a particular range of dates.
Events
Events are raised for nearly every request made by the client-side UI to the server-side Web Management API. In most cases, events are available both before and after a server-side operation is performed. The GetWebEvent method, for example, gives you an opportunity to add some server-side logic to allow/disallow retrieval of a particular type of web event and also to alter the web event information before it is returned.
Here's a summary of the events that correspond to various Health Monitoring features of Dot Net Dash:
Method
Events
GetWebEventSummaries
GettingWebEventSummaries, GotWebEventSummaries
GetWebEvents
GettingWebEvents, GotWebEvents
GetWebEvent
GettingWebEvent, GotWebEvent
DeleteWebEvents
DeletingWebEvents, DeletedWebEvents