मैं एक कॉन्फ़िग फ़ाइल की तरह:RollingFlatFileTraceListenerData कैसे जोड़ें प्रोग्राम के रूप में
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</configSections>
<loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="Tracing" logWarningsWhenNoCategoriesMatch="true">
<listeners>
<add listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.SystemDiagnosticsTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" type="System.Diagnostics.ConsoleTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="System Diagnostics Trace Listener"/>
</listeners>
<formatters>
<add template="{message}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Text Formatter"/>
</formatters>
<categorySources>
<add switchValue="All" name="AppLog">
<listeners>
<add name="System Diagnostics Trace Listener"/>
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events"/>
<notProcessed switchValue="All" name="Unprocessed Category"/>
<errors switchValue="Off" name="Logging Errors & Warnings"/>
</specialSources>
सांत्वना श्रोता मेरे पास है कि इसके अलावा, मैं प्रोग्राम के रूप में एक RollingFlatFileTraceListenerData परिभाषित करना चाहते हैं:
var listener = new RollingFlatFileTraceListenerData("AppLog", @"c:\log.log", "", "", 0, "yyyyMMdd-hhmm", Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollFileExistsBehavior.Increment, Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollInterval.Hour, TraceOptions.LogicalOperationStack, "Text Formatter");
कैसे क्या मैं अपने नए परिभाषित श्रोता को श्रोताओं की सूची में प्रोग्रामेटिक रूप से जोड़ सकता हूं?
एप्लिकेशन_स्टार्ट केवल एक बार से अधिक बार आग लगती है जब ऐप-पूल पुनरारंभ होता है। आईआईएस स्वचालित रूप से ऐसा करता है जब समय के लिए अनुरोध नहीं किया गया है, या रीसाइक्लिंग नियमों के आधार पर। हालांकि कोई मुद्दा नहीं होना चाहिए, क्योंकि यह एक नए नए 'एचटीपी अनुप्रयोग' से शुरू होगा –