WCF Service Trace Viewer
Posted on February 9, 2007
Filed Under Uncategorized | Leave a Comment
In my last post we got the Getting Started WCF sample up and running within IIS. Now if you’re like me and expect software to failure, then before going any further into WCF you need to get your head around how to troubleshoot problems and/or view what’s going on between client and server applications.
WCF has done two great things:
- It has built upon the System.Diagnostics namespace to provide a tracing model.
- Provided a tracing tool for viewing tracing data.
Now within your application, configure tracing and message logging (read here for more details on individual configuring tracing and message). In this article, the following is the key sharedlistener that emits trace data into an XML file:
<sharedListeners>
<add initializeData=”C:\logs\TracingAndLogging-service.svclog“
type=”System.Diagnostics.XmlWriterTraceListener”
name=”xml” />
</sharedListeners>
Now that’s the creation of the trace data done (1). Now open up the Service Trace Viewer Tool (SvcTraceViewer.exe) that was installed as part of the Windows SDK. My install put it under:
- c:\Program Files\Microsoft SDKs\Windows\v6.0\Bin\
Do the following:
- Run your newly traceable WCF application
- Run the Service Trace Viewer Tool
- Select File|Open and browse your newly created <filename>.svclog file
I suggest going back to the Service Trace Viewer Tool page and learning what all this tracing means. It does makes sense after a while but you do have to do a bit of reading and re-running your application in debug mode to see how the messages flow. Definitely worth a good block of your time now. Then when you have the basics, read this article on viewing correlated traces that is crucial for troubleshooting WCF applications with large amounts of data.
Good luck!
Comments
Leave a Reply

