ASP.Net 2.0 Inbuilt Project Health Monitoring Feature in 2.0

The 2.0 Version of ASP.Net provides the much needed project health monitoring through its inbuilt Health Monitoring feature. Add few tags and their values in the Web.Config and you project will be automatically monitored.

It lets you write to  EventLog, SQL Server and also lets you write your own provider. The easiest feature that can be implemented almost in no time is the "Email Sending" feature. It removes the  need 
of the logging, and the mailing code in the website framework. This feature is so intelligent that it sends only a 
single email for the set interval. This makes sure that you dont get many emails flooding your mailbox.


You will have to add the "healthMonitoring" Config section under the "System.Web" to your Web.Config and set the 
key-values as 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>
By [)ia6l0 iii   Popularity  (656 Views)