Curia Damiano blog

Insert my slogan here...

Configuring WCF Tracing

WCF is heavely based on configuration, so it isn't really easy to debug; logging can help developers in understanding what's happening: what calls are made, what exceptions are thrown, and so on.

To enable logging, you have to insert the following lines in the web.config file of the service application (often it's just your web-site):

<system.diagnostics>
  <trace autoflush="true" />
  <sources>
    <source name="System.ServiceModel"
      switchValue="Information, ActivityTracing"
      propagateActivity="true">
      <listeners>
        <add name="sdt"
          type="System.Diagnostics.XmlWriterTraceListener"
          initializeData="C:\Logs\Traces.svclog" />
      </listeners>
    </source>
  </sources>
</system.diagnostics>

Then you can open you *.svclog files with the Service Trace Viewer Tool, found in the local file SvcTraceViewer.exe

More details in the articles Service Trace Viewer Tool (SvcTraceViewer.exe) and Configuring Tracing.

Loading