Currently, log files can be configured in three ways: configuring new environment variables, configuring old environment variables, and configuring configuration files. The priorities are in descending order. Configuring old environment variables and configuration files will be unavailable in the future. You are advised to configure logs by configuring new environment variables. For details about how to configure logs by configuring new environment variables, see MindIE Log Reference.
MindIE component names (mindie prefix omitted) [cert, ms, server, llm, sd]
Environment Variable |
Default Configuration |
Value Range and Description |
|---|---|---|
MINDIE_LOG_LEVEL |
INFO |
Sets the log level of each MindIE component. The priority is higher than that of the MINDIEMS_LOG_LEVEL environment variable. If the environment variable is set, the log_level parameter in the JSON configuration file will be overwritten. The log levels are [CRITICAL, ERROR, WARN, INFO, DEBUG]. |
MINDIE_LOG_TO_FILE |
true |
Sets whether to write logs of each MindIE component to a file. If the environment variable is set, the to_file parameter in the JSON configuration file will be overwritten. The value range is [false, true] or [0, 1]. |
MINDIE_LOG_TO_STDOUT |
false |
Sets whether to print logs of each MindIE component. If the environment variable is set, the to_stdout parameter in the JSON configuration file will be overwritten. The value range is [false, true] or [0, 1]. |
MINDIE_LOG_VERBOSE |
true |
Sets whether to add optional log content to logs of each MindIE component. Logs are classified into fixed log content and optional log content. The complete debug log format is as follows: [Date time] [PID] [TID] [Component name] [Uppercase log level] [File:line] : [Error code] [*] Log message. The non-bold content is optional. When the environment variable is set to true, the optional content is added. The value range is [false, true] or [0, 1]. NOTE:
[*] in the log format indicates the name of a subcomponent or a small module. You can choose to display the name in logs to better locate faults. |
MINDIE_LOG_PATH |
~/mindie/log |
Sets the directory for storing log files of each MindIE component. If this environment variable is set, create the log/ directory in the path specified by this environment variable. The debug logs are recorded in the $MINDIE_LOG_PATH/log/debug directory, and the security logs are recorded in the $MINDIE_LOG_PATH/log/security directory by default.
|
MINDIE_LOG_ROTATE |
|
Sets the log rotation of each MindIE component. The format for rotating logs of a component: Component name: -fs filesize -r rotate
|
Example 1: Set the log level of all MindIE components to debug and the log level of the cluster management component to info (the value entered by the user is case insensitive). export MINDIE_LOG_LEVEL=debug; ms:INfo Example 2: Set the log level of the MindIE LLM to error (the value entered by the user is case insensitive). export MINDIE_LOG_LEVEL=llm: error If the log level is null, the log function is disabled. Example 3: Set all MindIE components to print logs (the value entered by the user is case insensitive). export MINDIE_LOG_TO_STDOUT=1 Example 4: Write logs of all MindIE components to files (the value entered by the user is case insensitive). export MINDIE_LOG_TO_FILE=true Example 5: Do not print or save the optional logs of all MindIE components (the value entered by the user is case insensitive). export MINDIE_LOG_VERBOSE=false Example 6: Print or save the optional logs of the cluster management component (the value entered by the user is case insensitive). export MINDIE_LOG_VERBOSE=ms:true" Example 7: Set the directory for saving the cluster management component logs to /home/dev. export MINDIE_LOG_TO_FILE=ms:/home/dev Example 8: Set the rotation of the cluster management component. The maximum size of each file is 10 MB, and the maximum number of files for each process is 20. export MINDIE_LOG_ROTATE=ms:-fs 10 -r 20
In the same log configuration command, the latter configuration overwrites the former one. The log configurations are separated by semicolons (;) and imported one by one.
Environment Variable |
Value Range and Description |
|---|---|
MINDIEMS_LOG_LEVEL |
NOTE:
MINDIEMS_LOG_LEVEL is reserved for compatibility with the configuration mode of earlier versions. If MINDIE_LOG_LEVEL is left blank, MINDIEMS_LOG_LEVEL is used. You can dynamically set the level of logs generated by the cluster management component client. The default value is empty. The priority of this environment variable is higher than that of the log_level parameter in the JSON configuration file. The log levels are as follows:
|
export MINDIEMS_LOG_LEVEL={Log print level}
"log_info": {
"log_level": "INFO", // Log level
"run_log_path": "/var/log/mindie-ms/run/log.txt", // Path of the file to which run logs are written
"operation_log_path": "/var/log/mindie-ms/operation/log.txt" // Path of the file to which operation logs are written
"max_log_file_size": 20, // Maximum log file size
"max_log_file_num": 10 // Maximum number of log files
}
export HSECEASY_PATH=$MIES_INSTALL_PATH/lib