OnixS CBOE CSM Handler for C++
Controlling Handler Logging
Advanced Programming

Controlling Logging in Handler

Handler logs important aspects of its execution. Logs are stored to the directory, specified by the OnixS::CBOE::MarketData::CSM::HandlerSettings::logDirectory member value. Logging includes network data, received and processed by Handler, and, of course, errors occurred at execution time.

Since Handlers output logging data into regular files, this affects their performance and sometimes requires significant system resources like space on hard drive. OnixS::CBOE::MarketData::CSM::HandlerSettings expose several parameters which allow to suppress the certain kinds of logging data and, thus, to reduce a load on the file system and increase a general performance.

The following table describes logging-related parameters, exposed by the OnixS::CBOE::MarketData::CSM::HandlerSettings structure:

Settings Member Default value Description
logLevel OnixS::CBOE::MarketData::CSM::LogLevel::Info

Specifies whether handler's instance must output informational messages about its state, as well as which kind of information must be put into the log.

For more information, please, take a look at the description of OnixS::CBOE::MarketData::CSM::LogLevel enumeration entries.

logSettings OnixS::CBOE::MarketData::CSM::LogSettings::Default

If logging is activated, this member specifies which additional data must be put into the log.

For more information, please, take a look at the description of OnixS::CBOE::MarketData::CSM::LogSettings enumeration entries.

Activating Logging Example

The following example demonstrates how to enable logging:

settings.logLevel = OnixS::CBOE::MarketData::CSM::LogLevel::Debug;

settings.logDirectory = "./logs";

// Log messages will be stored in the file, as well as received binary packets and full state of updated order books.
settings.logSettings = LogSettings::TraceToFile|LogSettings::LogPackets|LogSettings::LogBooks;