Search This Blog

Sunday, May 28, 2017

How can I see WCF server logs?

What is suggested here worked for me.
This is cleaner. Update: this has always been working for me, and seems more complete/easier. Put it  right before the closing configuration outer node.

<system.diagnostics>
  <sources>
    <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
      <listeners>
        <add name="ServiceModelTraceListener" />
      </listeners>
    </source>
    <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing">
      <listeners>
        <add name="ServiceModelTraceListener" />
      </listeners>
    </source>
    <source name="System.Runtime.Serialization" switchValue="Verbose,ActivityTracing">
      <listeners>
        <add name="ServiceModelTraceListener" />
      </listeners>
    </source>
  </sources>
  <sharedListeners>
    <add initializeData="Service.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelTraceListener" traceOutputOptions="Timestamp" />
  </sharedListeners>
</system.diagnostics>

No comments:

Post a Comment