To configure logging, the Handler provides the following settings.
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:
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:
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.
By default, the Handler uses LogLevels::Info. To set another log level, the user can use HandlerSettings::logLevel. For example:
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.
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.
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:
By default, the Handler uses a synchronous logger, but it can switch to an asynchronous logger with the following option:
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: