locked
How to trace production environment exceptions happened in a custom coded workflow RRS feed

  • Question

  • Hi,

    I am diagnosing a custom workflow developed in visual studio 2008.

    The production environment farm includes eight load balanced web front ends and the workflow stops unexpectedly.

    What would be the easiest way to see the exception that was thrown during the workflow execution? Does SharePoint maintain a log of workflow execution progress and errors happened?

    Thank you,

    Wednesday, April 11, 2012 2:34 AM

All replies

  • Hi amx2012

    Generally speaking, you should write workflow logs to the history list so that you can find out the errors globally even the exception was thrown in one of the web front end.

    In your case, you should add Fault Handlers to the workflow in the Fault Handler View and log the exception to the history list. Please refer to this article to add Fault Handler to workflow.

    You can also handle faults in the host process so that when an exception occurs in a workflow, bubbles up through the hierarchy, and is uncaught, you can get notified about the exception. The handler code looks like this:

    workflowRuntime.WorkflowTerminated += delegate(
      object sender, WorkflowTerminatedEventArgs e)
    {
      Console.WriteLine(e.Exception.Message);
    };

    Also record the exception to history list so that you can log them, for more information, please refer to this document .

    Thanks,


    Lambda Zhao

    TechNet Community Support

    Friday, April 13, 2012 6:14 AM
  • Hi Lambda,

    can I use this statement in Sharepoint workflows?

    Console.WriteLine(e.Exception.Message);


    When an unhandled exception happens in a workflow, is it going to be logged anywhere?

    Thank you,

    Sunday, April 15, 2012 6:08 PM