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 uses the environment variable MX_INDEX_HOME to locate logs. (A logs directory needs to be created in the directory specified by MX_INDEX_HOME.)

Log Configuration File (logging.conf)

# MindX INDEX configuration file
# Program name
# Project name, which can be specified randomly.
program_name=mxIndex
# log output directory
# Log output folder. Create it in the MX_INDEX_HOME directory in advance.
log_dir=logMxIndex
# whether to output log file to specified filepath
# Whether to output the log to the specified directory
set_log_destination=true
# log file basefile
# Log file name prefix
base_filename=mxidx.log.
# Output the log to the stderr file instead of the log file.
logtostderr=false
# 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 stderr and file, where level >= global_level,default is 0
# Log level: -1-debug, 0-info, 1-warn, 2-error, 3-fatal.
# Output the log whose level is greater than or equal to this value to the stderr and log files. The default value is 0.
global_level=0
# max log size, unit is MB, max_log_size value >= 1 and must be an integer, default is 100
# 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 100.
max_log_size=100
# rotate time of log switch: 7 days(default)
# Log file rotation switch. The default value is 7 days.
rotate_day=7
# rotate file number of log switch: 50 (default)
# Switch for rotating the number of log files. The default value is 50.
rotate_file_number=50