Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: .NET
Expertise: Advanced
Jul 22, 2008

ASP.NET 2.0's Project Health Monitoring Feature

ASP.NET 2.0 provides much needed project health monitoring through its Health Monitoring feature. Simply add few tags and their values in Web.Config and your project will be automatically monitored.

This feature allows you to write to EventLog, SQL Server, and also lets you write your own provider. The easiest feature to implement is the "Email Sending" feature. This eliminates the need to log and mail code in the web site's framework. This feature is so intelligent that it sends a single email for the set interval, thus not flooding your mailbox. Add the "healthMonitoring" config section under the System.Web to Web.Config and set the key-values as shown in the code below:


<healthMonitoring enabled="true">
         <providers>
            <add name="EmailProvider" 
               type="System.Web.Management.SimpleMailWebEventProvider"
               from="PostMaster_ProjectName@projects.com"
               to="Developer@projects.com"
               subjectPrefix="Error: "
               buffer="true"
               bufferMode="Notification" />
         </providers>
         <rules>
            <add provider="EmailProvider" name="All App Events"  eventName="All Errors" />
         </rules>
      </healthMonitoring>

Also add the System.Net Section for the SMTP Server Configuration
   <system.net>
      <mailSettings>
         <smtp from="mySMTP@projects.com">
            <network host="smtp.projects.com" />
         </smtp>
      </mailSettings>
   </system.net>
Srinath MS
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap