The following section describes how you could implement custom configuration file to enable logging for KAV SDK, and describes settings you could use in the configuration file to tailor logging to your environment.
To implement logging configuration:
kave.ini; the name is important and must not be changed.The kave.ini configuration file consists of sections, properties and values that these properties can take. Structure of the file confirms to standard format of INI file that follows the entity-attribute-value model (EAV). Typical INI file looks as follows:
[Section]
Property=value #comment
Logging configuration file here has a single entity, a section that contains attributes, or properties, and their values. Properties characterize the entity where their values characterize properties themselves. In KAV SDK all the properties pertain to a single section called Logging.
Depending on the platform on which you use the KAV SDK, a set of properties may vary; some properties are applicable for Windows platform where others may be used only on a UNIX-like systems such as distributions of Linux, see section "System requirements" for more details about supported platforms. For example, there is no syslog daemon on Windows platform, hence the Syslog property is only supported on UNIX-like platforms. Information about what properties can be used is listed later in this section.
The following table describes in properties of the logging configuration file.
Configuration file properties
Property |
Description |
|---|---|
|
Specifies if previous log files are kept intact or are deleted on each initialization of KAV Engine. The SDK checks for the value of the Possible values:
|
|
Sets the limit, in Mbytes, for the maximum size of the log file. Possible values: Any positive integer in the range 0 to 4095 with border values being:
Setting the limit to a non-zero value automatically turns on append mode regardless of the value specified for the Supported platform: Windows. This parameter is ignored on UNIX-like platforms. |
|
Level of logging detail specifying how much tracing data is output. Possible values:
|
|
Path to store log files. This parameter specifies a path at which to store the log files. When specifying paths, please obey the conventions of the target platform, e.g. make sure to use backward slashes as path separators on Windows platform, and use forward slashes to separate directories on UNIX-like platforms. Do not enclose path in quotes and do not escape the space character. Long path with spaces are good to go unless they exceed the Possible values:
The full custom path for the LOG files must not exceed the limit of 260 characters, applied by This integer number does not include additional length restrictions such as null terminator used in C strings and other restriction imposed by platforms such as when the file system stores additional short name in 8.3 format with the original file name for sake of compatibility with obsolete applications. Supported platform: all platforms supported by KAV SDK. |
|
Output logging data to a system log maintained by Syslog daemon. When using Syslog, you may want to output logging data to log files, other programs, or redirect them to another host, as configured the configuration file for the Syslog daemon. This logging feature is supported for the the in-process, out-of-process and service modes of integration. Logging detail is maintained by the Possible values:
Before you use output to Syslog, make sure to configure syslog daemon for debug logging. Add the following line to the
Syslog configuration file is typically located at Supported platform: UNIX-like platforms with installed Syslog daemon. This parameter is not supported on Windows platform. |
Remarks
Log files are created per session. When a new scanning session starts, that is the kaveInitizlizeEx function returns, a new a log file is created at the location specified by LogsFolder. Each log file is given the name of the the INI configuration file and is postfixed with the process ID (PID). Postfixing is done to distinguish between log files for specific processes when simultaneous scanning is made and several scanner processes start in a single scanning session.
Changes to kave.ini configuration file take effect at the runtime of KAV SDK. You can alter the configuration parameters any time while KAV SDK is running without having to re-initialize the SDK. The SDK polls the file for changes so that they take effect automatically in a few seconds when values are altered.
When using append logging mode, several features must be noted. If the KAV SDK library is initialized in out-of-process mode a separate log file is created for each started process of KAV SDK. Because the out-of-process integration mode implies that all scanning processes are arbitered by a monitoring process. Thus, for n started scanning there is a yet on single arbiter process. This results in n+1 started process pertaining to KAV SDK. A separate log file is for each of such processes effectively giving n+1 log files that are created for such a scanning session (n is the number of scanning kavehost processes started by the parent, called arbiter, process).
The parent process arbiters scanning tasks between your client and scanning processes of KAV SDK. All the information regarding the tasks managed by the arbiter process, interprocess communications management modules (kavessi and ipclib libraries), dispatcher module (kavesd library), and a module interfacing to your client application (kave8 library) is output to the file referenced by the PID of the arbiter process.
Information about processing of scanning tasks issued by the arbiter process and the KAV Engine is stored in the log files each referring to a specific scanning process. This data contains messages from the ipclib interprocessing module, the hosting process for the KAV Engine (the kavehost executable), and the control module of scanning meachanism (the kavess library). Such log files are postfixed with the PID of their related kavehost host processes.
In some cases, your Technical Account Manager may ask you to enable advanced logging. Advanced logging may help Kaspersky Lab specialists investigate troublesome issues.
To enable advanced logging:
kave.ini file (create a new one in the folder with kavehost binary if needed)Logging section add the BssLogsFolder option and specify a location to store the files with advanced logging data.This must be a separate location than your standard logging data location (specified in LogsFolder).
Examples
The following example lists a sample configuration file for each of the target platforms. You can find properties described in the table in this section.
The following sample configuration file may be used on Windows platform.
Example: [LOGGING] SizeLimit=0 WriteLog=9 Append=0 LogsFolder=.\logs |
The following sample configuration file may be used on a UNIX-like platform.
Example: [LOGGING] WriteLog=9 Append=0 LogsFolder=./logs Syslog=0 |