Describes how to control the Handler's log output and how to be notified about non-critical issues.
The Handler logs all significant aspects of its execution. The log files are stored in the directory specified by the HandlerSettings::logDirectory member value. Logging includes network data received and processed by the Handler and, of course, errors occurred at the execution time.
Since the Handler outputs logging data into regular files, this affects its performance and sometimes requires significant system resources, like space on the hard drive. The Handler exposes several parameters which allow adjusting certain kinds of logging and thus reducing the system load and increasing general performance.
The following list describes logging-related parameters exposed by the HandlerSettings structure:
Settings member: HandlerSettings::logLevel
Default value: LogLevel::Info
Specifies whether the 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 LogLevel enumeration entries.
Settings member: HandlerSettings::logSettings
Default value: LogSettings::Default
If the 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 LogSettings enumeration entries.
The following example demonstrates how to set up the logging at maximum level :
Logging adds overhead on the processing path, so disabling it is a recommended low latency optimization. Use this code snippet to disable all logging operations:
Miscellaneous non-critical issues may occur while the Handler's instance is being executed. The Handler processes such matters on its own; thus no special handling is required in that case. However, sometimes it is reasonable to be notified about such events. For this purpose, the Handler represents WarningListener class and invokes its WarningListener::onWarning member each time a non-critical issue occurs.