December 9, 2019
Service Trace Viewer
R
ecently I had to do some debugging of a WCF service. I used trace logs for this, but the output format of the
tracelogs is a wall-of-text xml file.
Luckily, Microsoft has created a viewer that facilities working with these tracelog xml files, “ServiceTraceViewer”.
For Windows 10, the viewer is installed along with the windows SDK, which is available at this URL:
https://go.microsoft.com/fwlink/p/?LinkId=619296
Note that to add trace logs to a WCF service all you need to do is add some entries to the web.config file.
<!-- log TRACE messages-->
<listeners>
<add name="lcars_listener" type="System.Diagnostics.TextWriterTraceListener" initializeData="e:\logs\lcars.services.configuration.log" />
<remove name="Default" />
</listeners>
</trace>
<!-- log WCF traffic/messages -->
<sources>
<source name="System.ServiceModel"
switchValue="Information, ActivityTracing"
propagateActivity="true">
<listeners>
<add name="lcars_listener" />
<remove name="Default"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add name="lcars_listener"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="e:\logs\lcars.services.configuration.svclog">
</add>
</sharedListeners>