Mike Taulty's Blog
Bits and Bytes from Microsoft UK
WCF: Tracing and Diagnostics

Blogs

Mike Taulty's Blog

Elsewhere

Archives

When I first saw a WCF build I had a play around with the tracing capabilities and, at the time, I wasn't particularly impressed. It might have been the build of the tracing viewer tool, it might have been my lack of knowing what to do or a combination of both.
 
In recent builds, I hadn't been back to revisit the capabilities as I'd assumed that there wasn't much there. But today ( in trying to get something to work ) I revisited it and it's absolutely brilliant. Not often that you'd hear me say that kind of thing but it really does look to "do the job" properly.
 
What's not so well documented right now is what the various trace sources are meant to be that you can switch on but I did find a documentation page that talked of;
 
Microsoft.InfoCards.Diagnostics
Microsoft.Transactions.Dtc
System.IO.Log
System.Runtime.Serialization
System.Security.Authorization
System.ServiceModel
System.ServiceModel.Messaging
 
I can't find a web link to that documentation page to reference here but it's in the SDK docs under "Windows Communication Foundation Administration and Diagnostics".
 
For my particular service, I used a config file that looked like this;
 
<configuration>
      <system.serviceModel>
            <diagnostics>
                  <messageLogging logMessagesAtTransportLevel="true"
logMessagesAtServiceLevel="true"
                                    logEntireMessage ="true"
maxMessagesToLog="1000"/>
            </diagnostics>
      </system.serviceModel>
      <system.diagnostics>
            <sharedListeners>
                  <add name="textListener"
     type="System.Diagnostics.XmlWriterTraceListener"
initializeData="c:\temp\logs\msgs.e2e"/>
            </sharedListeners>
            <sources>
                  <source name="System.ServiceModel.MessageLogging"
switchValue="All">
                        <listeners>
                              <add name="textListener"/>
                        </listeners>
                  </source>
                  <source name="System.ServiceModel" switchValue="All">
                        <listeners>
                              <add name="textListener" />
                        </listeners>
                  </source>
            </sources>
      </system.diagnostics>
</configuration>
 
I then opened up the msgs.e2e file after my apps had run with the svctraceviewer.exe tool that ships in the SDK>
 
I must admit that I'm still sitting here in that tool trying to get my head around all the different views that it presents to me but it certainly doesn't leave you with a lack of information which is what most tracing infrastructures seem to do. Nice :-)
 
 

Posted Thu, Dec 15 2005 6:29 AM by mtaulty

Comments

rimonabantexcellence site title wrote rimonabantexcellence site title
on Thu, May 23 2013 5:49 PM

Pingback from  rimonabantexcellence site title