Tracing Windows Workflow

Here’s a small little pearl I found while playing with Windows Workflow; WWF provides tracing through System.Diagnostics.  This is not tracking (which is a full blown service in WWF) but simple tracing, showing which workflows and activity has been executed.

The System.Diagnostics in .NET 2.0 should be familiar with anyone who’s used Enterprise Library in .NET 1.1.

To enable tracing on your Windows Workflow application add an app.config file to your application and in the <configuration> section add a <system.diagnostic> section.

System.Diagnostic has 2 sections in it: <switches> and <trace>.  <switches> contains the tracing options and information levels and <trace> tells the system where to write the trace file to (For more information on System.Diagnostic read it up on MSDN)

There are 5 classes provided by Windows Workflow to use: WorkflowTraceToDefault, Host, Runtime, Tracking and Activity.  The last 4 classes are Trace Switches, are optional and have 5 states: Off, Error, Warning, Info, Verbose (although All seems to be able to replace Verbose).  The first class is a Boolean Switch and is a required field.  Tracing is off by default for Windows Workflow so you’ll have to enable WorkflowTraceToDefault to get results.

Here’s an example of enabling Tracing:
  <system.diagnostics>
    <switches>
      <add name="WorkflowTraceToDefault" value="1" />
      <add name="Host" value="Error" />
      <add name="Runtime" value="Warning" />
      <add name="Tracking" value="Info" />
      <add name="Activity" value="All" />
    </switches>
    <trace autoflush="true" indentsize="4">
    </trace>
  </system.diagnostics>

Published Monday, February 27, 2006 12:32 AM by mailowl

Comments

# re: Tracing Windows Workflow

jvUTpz  <a href="qkmcivzvvluj.com/.../a>, [url=http://soporlqgzczq.com/]soporlqgzczq[/url], [link=http://rnndvymprwfb.com/]rnndvymprwfb[/link], http://csyugomepghh.com/

Monday, April 14, 2008 5:38 PM by eajipg

# re: Tracing Windows Workflow

comment4, <a href="http://index5.otimal.com">stratton woods condo assoc in bridgewater nj</a>,  kmsyib, <a href="http://index2.otimal.com">instructional fight videos</a>,  03867, <a href="http://index1.otimal.com">about the book all american girl</a>,  %-[, <a href="http://index4.otimal.com">gilmoregirls spoilers</a>,  tssoz,

Wednesday, June 25, 2008 11:21 PM by Albert

# re: Tracing Windows Workflow

comment3, <a href="http://index2.10-lod.com">harry and the henderson movie</a>,  105, <a href="http://index5.10-lod.com">fresh hot tigh ***</a>,  ssb, <a href="http://index1.10-lod.com">baron brass buckle mfg.</a>,  qexpbo, <a href="http://index4.10-lod.com">united frieght93 movie</a>,  29973,

Tuesday, July 01, 2008 5:00 AM by Sumot

# re: Tracing Windows Workflow

I'm sure that it works but i have a problem. Some error appears

Friday, August 22, 2008 3:56 PM by cracked server list cod2

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: