Wednesday, September 07, 2011

WCF–setting up tracing

All you need to do is to add is the following in your config file (under <Configuration>)

   <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true" >
     <add type="System.Diagnostics.DefaultTraceListener" name="Default">
      <filter type=""/>
     <add initializeData="myTraceLog.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="sdt" traceOutputOptions="DateTime, Timestamp">
        <filter type=""/>
  <trace autoflush="true"/>

The trace will get written to “myTraceLog.svclog” and can be viewed using “SvcTraceViewer.exe” which can typically be found at “C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin”

No comments: