Introduction
K2 blackpearl provides a native logging framework and auditing features that enables Administrators to monitor and troubleshoot the K2 blackpearl environment. System Event Logging is initiated automatically (default operation) from product installation and is active through to runtime. System auditing features are initiated manually by the developer per individual process at design time and leveraged during runtime.
The logging and auditing features of K2 blackpearl are built into the platform but operate and are configured in different ways. This whitepaper discusses each feature in detail.
Key areas discussed:
- System Extensibility
- Level of integration
- 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.
- Open the following file in notepad:
[SystemDrive]:\Program Files\K2 blackpearl\Host Server\Bin\HostServerLogging.config
- 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>
- Change the following line from:
<LogLocation Name="FileExtension" Active="False" LogLevel="All" />
To:
<LogLocation Name="FileExtension" Active="True" LogLevel="All" />
Change
<add key="IncludeStackTrace" value="False" />
To:
<add key="IncludeStackTrace" value="True" />
Change
<LogLocation Name="ConsoleExtension" Active="True" LogLevel="Info" />
To:
<LogLocation Name="ConsoleExtension" Active="True" LogLevel="Debug" />
- Save and close the file
- Restart the K2 Hostserver Service
- By default the newly generated log file will be in the same directory as the modified config file. Alternatively, verify the path in ‘LogFilePath’ setting in the config file or the log files will be located in the [SystemDrive]:\Program Files\K2 blackpearl\Host Server\Bin\directory.
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 the detailed, follow the steps below:
- Open '%ProgramFiles%\K2 [blackpearl\blackpoint]\Host Server\Bin\SourceCode.SmartObjects.Runtime.config' file with a text editor
Change:
<logging>
<serviceauthentication log="no" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\serviceauth.log" overwrite="no" />
<timestamping log="no" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\timestamp.log" overwrite="no" />
<brokerpackagein log="no" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\brokerpackagein.log" overwrite="no" />
<brokerpackageout log="no" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\brokerpackageout.log" overwrite="no" />
<servicepackagein log="no" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\servicepackagein.log" overwrite="no" />
<servicepackageout log="no" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\servicepackageout.log" overwrite="no" />
</logging>
To:
<logging>
<serviceauthentication log="no" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\serviceauth.log" overwrite="no" />
<timestamping log="no" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\timestamp.log" overwrite="no" />
<brokerpackagein log="yes" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\brokerpackagein.log" overwrite="no" />
<brokerpackageout log="yes" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\brokerpackageout.log" overwrite="no" />
<servicepackagein log="yes" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\servicepackagein.log" overwrite="no" />
<servicepackageout log="yes" path="%ProgramFiles%\K2 [blackpearl\blackpoint]\ServiceBroker\Logs\servicepackageout.log" overwrite="no" />
</logging>
- Save your changes to the config file.
- Restart the K2HostServer service
The log files will be created in the ‘path’ attribute for each setting.