Log Configuration File

The log framework is implemented based on glog and provides a configuration file to set basic log parameters.

The log configuration file (logging.conf) is stored in ${MX_SDK_HOME}/config. MX_SDK_HOME is the installation directory of the Vision SDK package, which must be valid.

Log Configuration File (logging.conf)

# MindX SDK configuration file

# Program name
# Project name, which can be specified randomly.
program_name=mindx_sdk

# log output directory, create logs directory before use
#Log output folder. If the folder is an absolute path, logs are output in this path. The absolute path can be set only in the home directory of the user. If the path is not an absolute path, logs are generated in the combined path of /log/mindxsdk and log_dir in the home directory.
log_dir=logs

# log file basefile
# Log file name prefix
base_filename=mxsdk.log.

# time to buffer the log in seconds, 0 means write to file immediately
# Set the log output period (in seconds). The value 0 indicates that logs are output immediately.
logbufsecs=0

# will output to file, where level >= global_level,default is 0
# Log level: -1-debug, 0-info
# Output the log whose level is greater than or equal to the value of this parameter to a file. The default value is 0.
global_level=0

# will output to stderr, where level >= console_level,default is 2
# Log level: -1-debug, 0-info, 1-warn, 2-error, 3-fatal
# Output logs whose level is greater than or equal to the value of this parameter to stderr. The default value is 2.
console_level=2

# max log size, unit is MB, max_log_size must be an integer, default is 10. 1 <= value <= 20
# Maximum size of a log file, in MB. The value of max_log_size must be a positive integer greater than or equal to 1. The default value is 10.
max_log_size=10

# rotate time of log switch: 7 days(default), 1<= value <= 1000
# Log file rotate switch: The default value is 7 days.
# Rotate days of the log file, which is collected based on a single process (only logs of the current process are collected).
rotate_day=7

# rotate file number of log switch: 50 (default, For each log level). 1 <= value <= 500
# Switch for rotating the number of log files. The default value is 50 (for each log level).
# Rotate file number, which is collected based on a single process (only logs of the current process are collected).
# The number of log files can be the same as the value of rotate_file_number only when the program exits normally. If the program exits abnormally, the actual number of log files may exceed the value of rotate_file_number.
rotate_file_number=50

# frequency of printing each log, frequency value must be an integer, default value is 1. 1 <= value <= 10000
# Frequency for printing each log. The value must be an integer greater ranging from 1 to 10000. The default value is 1.
flow_control_frequency=1