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

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


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

WEBINAR:

On-Demand

Application Security Testing: An Integral Part of DevOps


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
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date