This project has moved and is read-only. For the latest updates, please go here.

Service Trace Viewer

A good tool for viewing log files is the Service Trace Viewer from the .NET SDK (this can normally be found in the Start > Programs menu under the Microsoft Windows SDK > Tools folder).

The best format for this tool is the XmlWriterTraceListener, although it does understand the other XML formats to a limited degree.

Use the following config file, along with the Hello Logging sample program. You do not need to recompile the sample program, using the Service Trace Viewer only requires changes to the application config file.

<?xml version="1.0" encoding="utf-8" ?>
      <add name="xml"
         initializeData="HelloLogging.svclog" />
      <source name="HelloProgram" switchValue="Information,ActivityTracing">
          <clear />
          <add name="xml" />
      <source name="HelloWorker" switchValue="All">
          <clear />
          <add name="xml" />

You should get an XML file "HelloLogging.svclog" created in the example directory – if you don’t, check that the console logging is working (i.e. make sure you compiled with the TRACE flag).

To see your log, run the Service Trace Viewer tool (SvcTraceViewer.exe from the .NET SDK), and open up the log file, you should see log details similar to the following:

Trace Viewer Example

The trace viewer provides a graphical overview of how the activities relate to each other and allow you to easily narrow in on any problems in the code.

Note that the Service Trace Viewer can also correlate logs across multiple processes and services, providing an end-to-end view of your application. For an example, see the MSDN documentation


Last edited Jun 5, 2013 at 1:42 PM by sgryphon, version 8


Sjaaky Mar 6, 2012 at 10:23 AM 
When you use the extension .svclog for your logfile, the file is automatically associated with the Service Trace Viewer in Windows Explorer. ie. initializeData="HelloLogging.svclog"