Sony Arouje

a programmer's log

Diagnostic Trace (SVCLog) configuration for WCF

leave a comment »

Whenever I write any WCF service, I need to search in my snippets to find out the configuration to add Diagnostic traces for WCF. This post help me to pick the configuration any time when ever I need it.

  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel"
              switchValue="Information, ActivityTracing"
              propagateActivity="true">
        <listeners>
          <add name="traceListener"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData= "F:\Sony\Traces.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

 

Adding this configuration allows the WCF to log all the communication between the client and host in xml format. You can view svclog using SvcTraceViewer.exe, it shipped with Visual Studio and can found out in WCF installation location (C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin)

Advertisements

Written by Sony Arouje

November 10, 2011 at 2:34 pm

Posted in .NET, WCF

Tagged with , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: