Click here to Skip to main content
15,886,258 members
Articles / Web Development / ASP.NET

ASP.NET Health Monitoring - Building an EventLogWebEventProvider - Part 3

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
14 Apr 2010CPOL2 min read 9.8K   5  
ASP.NET Health Monitoring - Building an EventLogWebEventProvider

In my previous posts on this health monitoring series, I explain to you how and why I made my own EventLogWebEventProvider and which benefits you can achieve by using this provider or by making your own.

Now I'll write about how to use this new provider in one application.

Well, almost everything has been written about this topic and Microsoft has one good article on "How To: Use Health Monitoring in ASP.NET 2.0", so I won't even try to explain all the possible scenarios and configurations. I will simply explain the standard scenario.

Typically I simply want to keep track of two Web Event types:

  1. the ones related to application errors
  2. and the others related to application life cycle

As far as I notice, there are many people that simply track those from point 1.

Another decision to make is where to store these Web Events data. You do this by choosing a Web Event provider.

ASP.NET gives us out-of-the-box several providers and you can make your own provider. Once your provider is done, you can use it just like all the others.

In this example, I will use the newly created provider.

Now that I know exactly what to track and where to store it, I can update my configuration.

All health monitoring configuration data is stored in the system.web\healthMonitoring section and my standard configuration will look like:

XML
<healthMonitoring enabled="true">  
    <providers>    
        <add name="ExtendedEventLogWebEventProvider" 
	type="NG.Web.Management.EventLogWebEventProvider, 
	NG.Web" source="MyEvtLogSource" />  
    </providers>  
    <rules>    
    <clear />    
        <add name="Application Lifetime Events Default" 
	eventName="Application Lifetime Events" 
	provider="ExtendedEventLogWebEventProvider" profile="Default" />    
        <add name="All Errors Default" eventName="All Errors" 
	provider="ExtendedEventLogWebEventProvider" profile="Default" />  
    </rules>
</healthMonitoring>

Notice the source attribute from the ExtendedEventLogWebEventProvider, using it you can set which EventLog source to use.

Remember that when you create an EventLog source, you can choose to create a brand new EventLog and if you so choose, all entries written by this provider in this application context will be isolated from all the others providing one easy way for visual tracking and filtering.

With the health monitoring data in place, you should now be able to see the entries appearing in EventLog.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect everis
Portugal Portugal
Over 13 years of experience in the Software Development working mainly in the banking and insurance industry.

Over 3 year of experience as Operations Team Leader focused on Infrastructure Management and Software Configuration Management.

I've been honored with the Microsoft Most Valuable Professional (MVP) Award for three consecutive years, 2010, 2011 and 2012, in recognition to exceptional technical contributions and leadership.

Current / Recent Technical Projects
- Dominican Republic Instance management, including 2nd line System management, capacity management, SW monitoring and deploy management
- Colombian SECOPII Instance management, including 2nd line System management, capacity management, SW monitoring and deploy management
- Vortal Main Instance management, including 2nd line System management, capacity management, SW monitoring and deploy management
- Vortal Development ecosystem management, including Server management, , capacity management, SW monitoring and deploy management

Areas of Specialization:
- Operations Management - ISO 20000 & ISO 27001 driven
- Team Management and Coaching
- Technology Leadership, Solutions/Architecture
- Product life cycle management, Continuous Integration
- Technological background in Microsoft frameworks and tools.

Comments and Discussions

 
-- There are no messages in this forum --