Wednesday, July 13, 2011

WCF Tracing

To troubleshoot crazy WCF-related errors, a very good option is to trace all the events in the service. While the documentation on MSDN contains useful info, the changes required to actually enable tracing are not all listed there. 

The full settings, that are added to Web.config when enabling tracing through the WCF Configuration Editor, look like this:


<source name="System.ServiceModel" switchValue="Warning, ActivityTracing"
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
<add name="ServiceModelTraceListener">
<filter type="" />
<add initializeData="C:\Projects\MyProject\App_tracelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
<filter type="" />

No comments: