Configuring Log Rotation

When the file size exceeds the product of the size of each log file and the number of log files that can be written by each process, log rotation starts. The environment variable MINDIE_LOG_ROTATE is used to rotate logs.

The size of each log file ranges from 1 MB to 500 MB, and the default value is 20 MB. The number of log files that can be written by each process ranges from 1 to 64, and the default value is 10.

The format for rotating logs of a component: Component name: -fs filesize -r rotate

  • If there is no component name before the colon (:), all components will be set in a unified manner by default.
  • If multiple components are set at the same time, use semicolons (;) to separate them. The latest setting takes precedence and overwrites any previous configurations.
  • filesize indicates the size of each log file, and rotate indicates the number of log files that can be written by each process.

    The naming format for log rotation and aging: mindie-Component name_Process ID_Time.Rotation file ID.log

[Example 1] Set the size of each log file of all MindIE components to 500 MB:
export MINDIE_LOG_ROTATE="-fs 500"
[Example 2] Set the maximum size of the MindIE Torch log file to 40 MB and allow each process to write one log file:
export MINDIE_LOG_ROTATE="torch: -fs 40 -r 1"