سؤال

I am using VS2005 C# .NET 2.0

I am new to the use of Health Monitoring, and I am unsure how the log files are saved.

I have only configured my Web.config file, and I don't see any variable which declares where the log file will be saved.

Below is my Web.config code snippet:

<system.web>
    <healthMonitoring enabled="true" heartbeatInterval="0">
        <bufferModes>
            <clear/>
            <add name="Logging" maxBufferSize="1000" maxFlushSize="200" urgentFlushThreshold="800" regularFlushInterval="00:05:00" urgentFlushInterval="00:01:00" maxBufferThreads="1"/>
        </bufferModes>
        <providers>
            <clear/>
            <add name="MySqlWebEventProvider" type="System.Web.Management.SqlWebEventProvider" connectionStringName="SODConnectionString" maxEventDetailsLength="1073741823" buffer="true" bufferMode="Logging"/>
        </providers>
        <eventMappings>
            <clear/>
            <add name="All Audits" type="System.Web.Management.WebAuditEvent" startEventCode="0" endEventCode="2147483647"/>
            <add name="All Errors" type="System.Web.Management.WebBaseErrorEvent" startEventCode="0" endEventCode="2147483647"/>
        </eventMappings>
        <profiles>
            <clear/>
            <add name="Audit Logs" minInstances="1" maxLimit="Infinite" minInterval="00:00:15"/>
            <add name="Error Logs" minInstances="1" maxLimit="Infinite" minInterval="00:00:15"/>
        </profiles>
        <rules>
            <clear/>
            <add name="All Audits Default" eventName="All Audits" provider="MySqlWebEventProvider" profile="Audit Logs"/>
            <add name="All Errors Default" eventName="All Errors" provider="MySqlWebEventProvider" profile="Error Logs"/>
        </rules>
    </healthMonitoring>

</system.web>

May I know what are the other steps I will need to take?

هل كانت مفيدة؟

المحلول

This article should help you out...

http://msdn.microsoft.com/en-us/library/ff650305.aspx

The output depends on what you configure. Typically, you would go for EventLogs. But if you are doing extensive logging you may want to use different providers to output it in SQL or WMI.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top