Logging with K2[blackpearl]

What logging information is available with K2 and how can I get access to it?

On the K2 server install directory\hostserver\bin directory you will find an XML file named HostServerLogging.config

This file has all the configuration information for the logging performed by K2 server.

log-config.jpg

You can send log messages to a File, Event log, Server console and so on. The error levels and when exceptions are thrown whether you need stack trace to be logged as well are also configured here.

log-config-levels.jpg

Since K2 is building on top of WF you can also access the .xoml files generated by K2 for destination rules, line rules and other events. In here you can use the WF fault handling mechanism provided to log and/or handle errors. The event context  object “K2” gives you access to a Logger object forthe process sintance, which you can use to log messages.

K2.ProcessInstance.Logger.LogInfoMessage(“msg”, “my message”);

faulthandler.jpg

K2.net 2003 had event activity and process level exception handling bocks which allowed you to write custom code to handle exceptional scenarios. This will be available in K2[blackpearl]

You can also update K2 default template .xoml files to include your fault handling as standard. This will insert any logging code you have in to the process as you model.

If you look at K2 blackmarket you will also find a custom logger posted there – http://k2underground.com/k2/ProjectHome.aspx?ProjectID=2

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s