Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Filtering System.Diagnostics Trace messages
<system.diagnostics>
<!-- Add multiple sources for varying levels of tracing -->
<sources>
<source name="debugSource" switchName="defaultSwitch" switchType="System.Diagnostics.SourceSwitch">
<listeners>
<add name="eventLogListener" type="System.Diagnostics.EventLogTraceListener" initializeData="ASP.NET 2.0.50727.0" />
</listeners>
</source>
</sources>
<switches>
<add name="defaultSwitch" value="Error"/>
<!-- See System.Diagnostics.SourceLevels enum -->
</switches>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="eventLogListener" type="System.Diagnostics.EventLogTraceListener" initializeData="ASP.NET 2.0.50727.0" />
</listeners>
</trace>
</system.diagnostics>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.