Viewing the Log Configuration File

This section describes the device-side log configuration file. This file records the log level, log output path, total number, and single log file size of system logs on the device.

Overall Configuration Description

  • In the Ascend EP standard form, the host does not have a log configuration file and does not have the permission to log in to the device to modify the log configuration file. Generally, you do not need to modify the log configuration file.
  • The log configuration files are stored in the following directory on the device:
    • Atlas 200/300/500 Inference Product: /var/log/npu/conf/slog/slog.conf
  • In multi-user scenarios, the configuration file can only be modified by the running user of the log process.
  • Modify log configuration options based on the recommended values or value ranges described in the related table. Otherwise, system exceptions may occur.
  • Manually modify the device-side configuration file and restart the slogd process for the modification to take effect. For details about how to restart the log process, see Restarting Log Processes.

Configuration Options in the slog.conf File

Table 1 Configuration options in the slog.conf file

Configuration Option

Description

global_level

Global log level. Only debug logs are supported.

  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR
  • 4: NULL (no log output)
  • Other values: invalid

enableEvent

Event logging enable:

  • 1: enabled
  • 0: disabled

SLOG, IDEDD, DVPP ...

Log level of each module on Ctrl CPU:

  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR
  • 4: NULL (no log output)
  • 5: invalid. The global_level setting applies.
NOTE:
  • If the module log level is 5, and the global log level is 0, 1, 2, or 3, the module log level is subject to the global log level.
  • If the module log level is 5 and the global log level is 4, module logs are not printed.
  • If the module log level is 5 and the global log level is invalid, the module log level is ERROR.
  • If the module log level is 4, module logs are not printed.
  • If the module log level is 0, 1, 2, or 3, the corresponding module log level applies.

TS, TSDUMP...

Log level of each module on non-Ctrl CPUs:

  • 0: DEBUG
  • 1: INFO
  • 2: WARNING
  • 3: ERROR
  • 4: NULL (no log output)
  • 5: invalid. The global_level setting applies.
NOTE:
  • If the module log level is 5, and the global log level is 0, 1, 2, or 3, the module log level is subject to the global log level.
  • If the module log level is 5 and the global log level is 4, module logs are not printed.
  • If the module log level is 5 and the global log level is invalid, the module log level is ERROR.
  • If the module log level is 4, module logs are not printed.
  • If the module log level is 0, 1, 2, or 3, the corresponding module log level applies.

DeviceOsMaxFileNum

Number of device-os_*.log files stored in the debug/device-os directory. If the number of stored files is greater than the configured value, new log files overwrite the earliest ones.

DeviceOsMaxFileSize

Size of a device-os_*.log file in the debug/device-os directory. If the file size is greater than the configured value, a new log file is generated.

NOTE:

You can adjust the size based on the actual situation. If the configured value is smaller than 1 (MB), the size 1 (MB) is used by default.

DeviceOsNdebugMaxFileNum

Number of device-os_*.log files stored in the run/device-os or security/device-os directory. If the number of stored files is greater than the configured value, new log files overwrite the earliest ones.

DeviceOsNdebugMaxFileSize

Maximum size of a device-os_*.log file in the run/device-os or security/device-os directory. If the size of a log file exceeds the maximum, a new log file is generated.

NOTE:

You can adjust the size based on the actual situation. If the configured value is smaller than 1 (MB), the size 1 (MB) is used by default.

DeviceMaxFileNum

Number of device-id_*.log files stored in the device-id directory. If the number of stored files is greater than the configured value, new log files overwrite the earliest ones.

DeviceMaxFileSize

Size of a device-id_*.log file in the device-id directory. If the file size is greater than the configured value, a new log file is generated.

NOTE:

You can adjust the size based on the actual situation. If the configured value is smaller than 1 (MB), the size 1 (MB) is used by default.

DeviceAppDirNums

Number of saved device-app-pid directories.

DeviceAppMaxFileNum

Number of device-app-pid_*.log files stored in each device-app-pid directory. If the number of stored files is greater than the configured value, new log files overwrite the earliest ones.

NOTE:

In the Ascend EP standard form, the device-side app logs are flushed to the log file device-app-pid_*.log on the device only when the logs fail to be transferred to the host.

DeviceAppMaxFileSize

Size of a device-app-pid_*.log file in each device-app-pid directory. If the file size is greater than the configured value, a new log file is generated.

SysLogBufSize

Buffer size of the system log device-os_*.log.

AppLogBufSize

Buffer size of the application log device-app-pid_*.log.

logAgentFileDir

Log file path. To change the path, ensure that the log process running user has the read and write permissions on the path.

NOTE:
  • The log path supports a maximum of only 255 characters. If the path is too long, it will be truncated.
  • In the Ascend EP standard form, if you change the path, ensure that the path exists and the owner is the user of the run log process. In the container scenario, see section "Installing the Operating Environment (in a Container)" in CANN Software Installation Guide. Mount the log path and log configuration file of the host machine to the container.

permission_for_all

Whether to allow a user of a group different from the slogd running user to write logs during app execution.

  • 0: not allowed
  • 1: allowed