OnixS Eurex ETI Handler C++ library  9.22.0
API documentation
Controlling Handler Logging

Controlling Logging in the Handler

The Handler logs an important aspects of its execution into the directory specified by the OnixS::Eurex::Trading::HandlerSettings::logDirectory member value. Logging includes network data received and processed by the Handler and, of course, errors occurred at execution time.

Since Handler outputs logging data into regular files, this affects its performance and sometimes requires significant system resources like space on hard drive. Handler exposes several parameters which allows to suppress certain kind of logging data and thus reduce load to the file system as well as to increase general performance.

Following table describes logging-related parameters exposed by the OnixS::Eurex::Trading::HandlerSettings structure:

Settings Member Default value Description
logLevel OnixS::Eurex::Trading::LogLevel::Info Specifies whether Handler 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 description of OnixS::Eurex::Trading::LogLevel enumeration entries.
logSettings OnixS::Eurex::Trading::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 description of OnixS::Eurex::Trading::LogSettings enumeration entries.

Activating Logging Example

Following example demonstrates how to enable logging in the Handler:

using namespace OnixS::Eurex::Trading;
HandlerSetting settings;
// Activate logging.
// Set log level to Debug.
settings.logMode = LogModes::Debug;
// Don't forget to define folder where logs to be stored.
settings.logDirectory = "./logs";

Deactivating Logging Example

Following example demonstrates how to disable logging in the Handler:

using namespace OnixS::Eurex::Trading;
HandlerSetting settings;
// Deactivate logging.
settings.logSettings = LogSettings::NoTrace;

Asynchronous Logging

Handler provides an asynchronous logging facility. Asynchronous logging is the way to go to minimize file I/O latencies. Following example demonstrates how to enable asynchronous logging in the Handler:

using namespace OnixS::Eurex::Trading;
HandlerSetting settings;
// Activate logging.
settings.logLevel = LogLevel::Info;
// Trace log messages to file asynchronously.
// Don't forget to define folder where logs to be stored.
settings.logDirectory = "./logs";