I promised in my last post “Get long arrays from WCF service” that I would write one more post about how to debug a WCF service.  Also, this method of tracing a WCF service can be used in a deployment environment where you can’t use debug to find the problem. Copy the extract below node of system.diagnostics into your config file and you will get an trace file with the name MyListenerTrace.e2e. Then user Service Trace Viewer tool from visual studio sdk tools to see the log file.
1
2
3
4
5
6
7
8
9
10
<system.diagnostics>
  <trace autoflush=”true” />
  <sources>
    <source name=”System.ServiceModel” switchValue=”Information, ActivityTracing” propagateActivity=”true”>
      <listeners>
        <add name=”MyListener” type=”System.Diagnostics.XmlWriterTraceListener” initializeData= “MyListenerTrace.e2e” />
      </listeners>
    </source>
  </sources>
</system.diagnostics>

Image with found error.

For more details here is an article from MSDN.