Cum folosim Health Monitoring in ASP.NET 2.0 si ASP.NET 4.0

ASP.NET
Un articol excelent in care va este explicat pe larg cum sa folositi Health Monitoring in cadrul website-urilor dezvoltate cu ASP.NET puteti citi la http://msdn.microsoft.com/en-us/library/ff650305.aspx

Am simplificat putin articolul iar esentialul este urmatorul. Pentru a primi prin email toate erorile generate de website-ul tau personalizeaza si adauga urmatoarele linii in fisierul web.config.
 
<system.web>
        <healthMonitoring enabled="true" heartbeatInterval="0">
            <providers>
                <clear />
                <add name="MyMailWebEventProvider" type="System.Web.Management.SimpleMailWebEventProvider" to=nume@domeniu.ro from="system@domeniu.ro" buffer="false" subjectPrefix="[Exception] " />
            </providers>
            <rules>
                <clear />
                <add name="All Errors EMAIL" eventName="All Errors" provider="MyMailWebEventProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00"/>
            </rules>
        </healthMonitoring>
</system.web>
      
    <system.net>
        <mailSettings>
            <smtp from="system@domeniu.ro">
                <network host="mail.domeniu.ro" password="parola" userName="system@domeniu.ro"/>
            </smtp>
        </mailSettings>
    </system.net>

Add Feedback