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):

  <trace autoflush="true" />
    <source name="System.ServiceModel"
      switchValue="Information, ActivityTracing"
        <add name="sdt"
          initializeData="C:\Logs\Traces.svclog" />

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.