How to enable workflow tracing (debug)
This might come in handy whenever you (like myself and I am sure thousands of others) see some error in the execution of one workflow and found the completely useless messages like “Error Occurred”
Dig deep and find nothing
first troubleshooting step would be to enable verbose logging on the workflows category and check the SharePoint logs.
If this does not provide you with a clue on what might be going on, you can try the following thing:
Add the following code to the web.config of the site where the workflow is located after this key :
</System.Workflow.ComponentModel.WorkflowCompiler>
-----------------------------------------------------
<system.diagnostics>
<switches>
<add name="System.Workflow LogToFile" value="1" />
<add name="System.Workflow.Runtime" value="All" />
<add name="System.Workflow.Runtime.Hosting" value="All" />
<add name="System.Workflow.Runtime.Tracking" value="All" />
<add name="System.Workflow.Activities" value="All" />
<add name="System.Workflow.Activities.Rules" value="All" />
</switches>
</system.diagnostics>
-----------------------------------------------------
and before this key
<appSettings>
Try to start the workflow.
You should get a debug-level log file created on c:\windows\system32\inetsrv, workflowtrace.log
Additionally, it might happen that sometimes the workflowtrace.log file is not created automatically ( maybe some permission issues that I didn’t bother to investigate). Just create the file by hand and start the workflow.
You should have all the information you need to troubleshoot the issue in the file.
Cheers
Official content published here :http://support.microsoft.com/kb/972914