Article ID: 972914 - View products that this article applies to.
This article describes some examples that you can use to enable logging information for several Windows Workflow Foundation namespaces.
How to enable workflow loggingYou can use the configuration file to create output of Windows Workflow Foundation logging information to help in debugging scenarios. Windows Workflow Foundation uses the configuration format that was introduced in the Microsoft .NET Framework 2.0. The following examples show how to enable logging information for several Windows Workflow Foundation namespaces. To use a configuration file to configure the workflow runtime engine, you first must create a .config file for your application (app.config) or web service (web.config). For example, if you want to enable logging for a Test.exe application process, create a Test.exe.config file.
Example 1In this example, the first add node enables logging to a file. The file is created in the host application directory by using the name WorkflowTrace.log. In the remaining lines in this example, you can specify the namespaces for which to capture logging information and the amount of information that is traced.
Example 2In this example, you enable logging to a TraceListener by setting the name parameter equal to "System.Workflow LogToTraceListeners". When you set this parameter, Windows Workflow Foundation will enumerate each TraceListener created within the host application and send all logging information to the TraceListener.
Example 3In this example, an absolute path is specified in the initializeData attribute. Also, some additional options are specified by using the following traceOutputOptions attributes: ProcessId and DateTime.
If these attributes are being used for a Web application and if multiple instances of W3wp.exe are running, each attribute will create its own trace file. In this scenario, in addition to the WFTrace.log file, you will have files that are named <GUID>WFTrace.log, in which <GUID> is a unique identifier.
For more information about a workflow trace, visit the following MSDN Web site:
http://blogs.msdn.com/madhuponduru/archive/2008/01/17/workflow-trace.aspxFor more information about workflow configuration files, visit the following MSDN Web site:
Contact us for more help
Connect with Answer Desk for expert help.