OnixS ICE iMpact Multicast Price Feed Handler C++ library 8.18.0
Users' manual and API documentation
Loading...
Searching...
No Matches
Logging Services

To configure logging, the Handler provides the following settings.

Log Directory

To set a path to a directory where log files will be stored, a user can use HandlerSettings::logDirectory.

By default, the value for this setting is "./" (the current directory). Here is an example of how to set the path to the log directory:

handlerSettings.logDirectory = "logs";

Log File Name Prefix

The Handler allows you to set a prefix for the log file name. By default, the Handler uses IceImpactMulticastPriceFeedHandlerCpp as a prefix for the log file name. The user can use HandlerSettings::logFileNamePrefix to set a new prefix. For example:

handlerSettings.logFileNamePrefix = "log";

Log Level

The Handler provides the following log levels:

In normal conditions you should use Info log level or higher and Debug when you need to debug a Handler issue.

Attention
Avoid usage of Debug log level in Production.

By default, the Handler uses LogLevels::Info. To set another log level, the user can use HandlerSettings::logLevel. For example:

handlerSettings.logLevel = LogLevels::Debug;

Advanced Log Options

The Handler provides additional options to control various aspects of the logging subsystem. By default, the Handler sets HandlerSettings::advancedLogOptions to AdvancedLogOptions::Default, which means trace to a file only. See the other available options below.

Disable Logging

To completely disable logging, the user should set HandlerSettings::advancedLogOptions to AdvancedLogOptions::LogNothing. For example:

As a result, all other logging settings will be ignored and the Handler completely disables the logging subsystem.

Log Output

The Handler provides two options for where logs appear: in a file and/or in the console. To make the logs available in both places, do the following:

Asynchronous Logging

By default, the Handler uses a synchronous logger, but it can switch to an asynchronous logger with the following option:

Timestamps In Local Time

By default, the Handler uses UTC for timestamps of log records. Timestamps can be shown in the user's local timezone instead. To enable that, add the following option: