Diagnosing Issues with the OpenTelemetry Configuration

The log handler captures errors and warnings that arise from OpenTelemetry's C++ SDK as well as some application errors.

By default, logging is disabled. You can configure the behavior of OpenTelemetry logging using the MFOTL_DEBUGLOG environment variable:

set MFOTL_DEBUGLOG=<log_file_name>[;<log_level>]

You can use the following pseudo-variables for the construction of the log file name:

$(APPNAME)
Specifies the basename of the executable invoked to start the current process.
$(PID)
Specifies the operating system identifier for the current process.

For example, the following redirects log and error messages to a file that include the process name and pid:

set MFOTL_DEBUGLOG=/tmp/$(APPNAME).mfotl_debuglog.$(PID).log

In order to redirect log and error messages to the console, set the MFOTL_DEBUGLOG environment variable to console. For example:

set MFOTL_DEBUGLOG=console

Optionally, you can specify the log level to use. It can be one of the following values:

debug
All events are traced and produces the most verbose output.
info
All info, warning, and error events are traced.
warning
All warning and error events are traced.
Note: This is the default value.
error
Only error events are traced.

To specify a different log level append ;<log-level> to the value of the MFOTL_DEBUGLOG_LEVEL environment variable, for example:

set MFOTL_DEBUGLOG=/tmp/$(APPNAME).mfotl_debuglog.$(PID).log;info

Or:

set MFOTL_DEBUGLOG=console;debug