How do I do this in Logging App Block?

Oct 25, 2007 at 12:27 AM
blod line.

<system.diagnostics>
<sources>
<source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelMessageLoggingListener">
<filter type="" />
</add>
</listeners>
</source>
<source name="System.ServiceModel" switchValue="Warning, ActivityTracing" propagateActivity="true">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelTraceListener">
<filter type="" />
</add>
</listeners>
</source>
<source name="Microsoft.Practices.ObjectBuilder" switchName="MyProgram.Switch1">
<listeners>
<add name="TextWriterTraceListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="C:\AtlasLogs\app_messages.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
<add initializeData="C:\AtlasLogs\app_tracelog.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
<add name="TextWriterTraceListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="C:\AtlasLogs\log.txt " />
</sharedListeners>
<switches>
<add name="MyProgram.Switch1" value="All"/>
</switches>
</system.diagnostics>
Oct 25, 2007 at 4:53 AM
Hi,

If what you need is named switches, the answer is you can't using the logging block. You can set a switch value in the DefaultLevel property though.

Hope this helps,
Fernando