Tuesday, June 5, 2012

Diagnostics in WCF

for diagnostics - add the following to config

<system.diagnostics>
    <sources>
      <source propagateActivity="true" name="System.ServiceModel" switchValue="Error,ActivityTracing">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default"></add>
          <add initializeData="c:\logs\blah.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="traceListener"></add>
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

interestingly, if you add this twice the config still works.
 for bugs that stop the request from ever reaching the service, check the event log

No comments:

Post a Comment