Introduction

K2 blackpearl provides a logging framework and auditing features that enable you to monitor and troubleshoot your K2 blackpearl environment. System event logging happens automatically at installation and is active through runtime. System auditing features must be configured manually at workflow design time for runtime information to get recorded.

The logging and auditing features of K2 blackpearl are built in to the platform but operate and are configured in different ways. This whitepaper discusses each feature in detail.

Key areas discussed:

  • System
  • Level of integration
  • Extensibility
  • Configuration
  • How to leverage and make use of the system event logs and audit capability

Enable HostServer logging

The steps described in this section will enable an administrator to enable logging, but without a full discussion of system requirements and possible implications. Be advised that the steps should only be pursued after reviewing the accompanying document or under the direction of a K2 Consultant.

The steps required to enable server logging are described below.

  1. Open the following file in notepad:

    [InstallDrive]:\Program Files (x86)\K2 blackpearl\Host Server\Bin\HostServerLogging.config

  2. Find the following section:

    <ApplicationLevelLogSettings>
    <ApplicationLevelLogSetting Scope="Default">
    <LogLocationSettings>
    <LogLocation Name="ConsoleExtension" Active="True" LogLevel="Info" />
    <LogLocation Name="FileExtension" Active="False" LogLevel="All" />
    <LogLocation Name="EventLogExtension" Active="False" LogLevel="Debug" />
    <LogLocation Name="ArchiveExtension" Active="False" LogLevel="Debug" />
    <LogLocation Name="MSMQExtension" Active="False" LogLevel="Debug" />
    </LogLocationSettings>
    </ApplicationLevelLogSetting>
    </ApplicationLevelLogSettings>


  3. Change the following line from:

    <LogLocation Name="FileExtension" Active="False" LogLevel="All" />

    To:

    <LogLocation Name="FileExtension" Active="True" LogLevel="All" />

  4. Change

    <add key="IncludeStackTrace" value="False" />

    To:

    <add key="IncludeStackTrace" value="True" />

  5. Change

    <LogLocation Name="ConsoleExtension" Active="True" LogLevel="Info" />

    To:

    <LogLocation Name="ConsoleExtension" Active="True" LogLevel="Debug" />

  6.  Save and close the file
  7. Restart the K2 server

By default the newly-generated log file is located in the same directory as the modified config file. Alternatively, you can change the value for the ‘LogFilePath’ setting in the config file.

Enable SmartObject Server Logging

On all K2 Servers in the farm, you can enable detailed logging to help with SmartObject runtime debugging. To turn on this logging, follow the steps below:

With the release of K2 4.6.9 the SourceCode.SmartObjects.Runtime.config has been consolidated into a single configuration file called K2HostServer.exe.Config file, which is located in the \K2 blackpearl\Host Server\Bin folder on the K2 Server. The connection strings previously stored in these files are now retrieved from the K2HostServer.exe.Config file.
    1. Open [InstallDrive]:\Program Files (x86)\K2 blackpearl\Host Server\Bin\K2HostServer.exe.config file with a text editor

Change the no values to yes values for the last four lines, and keep your actual path to these files the same (unless you want them in a different location). The default configuration:

<logging>
<serviceauthentication log="no" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\serviceauth.log" overwrite="no" />
<timestamping log="no" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\timestamp.log" overwrite="no" />
<brokerpackagein log="no" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\brokerpackagein.log" overwrite="no" />
<brokerpackageout log="no" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\brokerpackageout.log" overwrite="no" />
<servicepackagein log="no" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\servicepackagein.log" overwrite="no" />
<servicepackageout log="no" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\servicepackageout.log" overwrite="no" />
</logging>


The configuration to enable SmartObject logging:

<logging>
<serviceauthentication log="no" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\serviceauth.log" overwrite="no" />
<timestamping log="no" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\timestamp.log" overwrite="no" />
<brokerpackagein log="yes" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\brokerpackagein.log" overwrite="no" />
<brokerpackageout log="yes" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\brokerpackageout.log" overwrite="no" />
<servicepackagein log="yes" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\servicepackagein.log" overwrite="no" />
<servicepackageout log="yes" path="%ProgramFiles%\K2 blackpearl\ServiceBroker\Logs\servicepackageout.log" overwrite="no" />
</logging>
  1. Save your changes to the config file.
  2. Restart the K2 server

 The log files are created in the ‘path’ attribute for each setting.