Enterprise Library logging in Process Exception Rule

  • 27 January 2011
  • 1 reply
  • 2 views

Badge +1

Hi,


Has anyone used/has an idea about how we can use Microsoft Enterprise Library's logging application block inside the Exception Rule code of a process in K2 to log error messages? The setup I have is as followed:


1. I have a Visual Studio 2008 solution with ASP.NET website project (containing presentation layer) and WCF services project (containing all business logic and data access). The WCF implementation classes invoke the K2 API to trigger/update workflow. Enterprise Library is configured in this solution to handle logging, and all code here logs errors using the logging application block.


2. I have another Visual Studio 2008 solution which has my k2 Project to design the workflows/processes.


In this k2 project, I would like to use the Exception Rule for each process to write custom code to log the exception. I want to use the Enterprise Library logging application block to do this (using the same configuration settings of the block as set in the ASP.NET project).


How do I go about doing this? I know I can add reference in the process designer to the enterprise library dlls. But what about the configuration of the logging block? Will i have to repeat the configuration in the K2HostServer.config file? I am quite lost as to how to achieve this objective. Any help or pointer in the correct direction is greatly appreciated.


Thanks.


1 reply

Badge +9

I haven't tried the Enterprise Library logging before but you are right that any configuration sections should be placed in the K2HostServer.config file.  This makes it global for all K2 process instances running on the server.  This is similar to what we do for the WCF endpoint configuration.

Reply