日志配置文件
本节介绍Device侧的日志配置文件。该文件中记录了Device侧系统类日志的日志级别、日志输出路径、日志数量、单个日志文件大小等配置信息。

- 对于Ascend EP场景,Host侧没有日志配置文件,且无Device侧的登录和修改日志配置文件的权限。一般情况下无需修改日志配置文件。
- 多用户场景下,仅支持日志进程的运行用户修改配置文件。
- 用户在修改日志配置项时,请严格按照相关配置项说明表格中的要求,根据建议值或取值范围进行配置,若不按照配置项配置要求,可能会导致系统异常。
- 手动修改Device侧配置文件后,需要重启slogd进程,使配置生效(此外需要注意:DeviceMaxFileNum和DeviceMaxFileSize字段为非Control CPU上日志配置项,需要重启log-daemon进程,使配置生效)。重启日志进程方法请参见重启日志进程。
#note, 0:debug, 1:info, 2:warning, 3:error, 4:null(no output log), default(3) global_level=3 # Event Type Log Flag, 0:disable, 1:enable, default(1) enableEvent=1 # note, 0:debug, 1:info, 2:warning, 3:error, 4:null(no output log), 5:invalid(follow global_level) SLOG=5 # Slog IDEDD=5 # ascend debug device agent DVPP=5 # DVPP CCE=5 # CCE HDC=5 # HDC DRV=5 # Driver MDCDEFAULT=5 # MDC UNDEFINE DEVMM=5 # Dlog memory managent KERNEL=5 # Kernel LIBMEDIA=5 # Libmedia ASCENDDK=5 # AscendDK ROS=5 # ROS HCCP=5 ROCE=5 PROFILING=5 # Profiling APP=5 # User Application call HIAI_ENGINE_LOG TDT=5 MD=5 MB=5 ME=5 CAMERA=5 TEEOS=5 BBOX=5 # note, 0:debug, 1:info, 2:warning, 3:error, 4:null(no output log), 5:invalid(follow global_level) TS=5 TSDUMP=5 LP=5 IMU=5 IMP=5 # set device-os_xxx.log file num, range is [1, 1000], default(3) DeviceOsMaxFileNum=3 # set device-os_xxx.log file size, range is [1048576, 104857600], default(2097152) DeviceOsMaxFileSize=2097152 # set (security/run/operation) device-os_xxx.log file num, range is [1, 1000], default(3) DeviceOsNdebugMaxFileNum=3 # set (security/run/operation) device-os_xxx.log file size, range is [1048576, 104857600], default(2097152) DeviceOsNdebugMaxFileSize=2097152 # set device-x_xxx.log file num, range is [1, 1000], default(10) DeviceMaxFileNum=10 # set device-x_xxx.log file size, range is [1048576, 104857600], default(2097152) DeviceMaxFileSize=2097152 # set device-app-xxx_xxx.log file num, range is [1, 1000], default(2) DeviceAppMaxFileNum=2 # set device-app-xxx_xxx.log file size, range is [524288, 104857600], default(524288) DeviceAppMaxFileSize=524288 # set device-app-xxx dir nums, range is [1, 96], default(24) DeviceAppDirNums=24 # set log file root path logAgentFileDir=/var/log/npu/slog # set permission for other user, 0: support user with same group, 1: support all user permission_for_all=0 # set log buf size, range is [64*1024, 1024*1024], default(256*1024) LogBufSize=262144 StackCorePath=var/log/npu/coredump
配置项 |
说明 |
---|---|
global_level |
设置全局日志级别。取值范围:
|
enableEvent |
设置是否开启Event日志。取值范围:
|
SLOG、IDEDD、DVPP…… |
设置Control CPU上各模块的日志级别。取值范围:
说明:
|
TS、TSDUMP…… |
设置非Control CPU上各模块的日志级别。取值范围:
说明:
|
DeviceOsMaxFileNum |
debug/device-os目录下保存device-os_*.log日志文件的数量,当日志文件数目大于该数目时发生滚动,新日志覆盖最早的日志。 |
DeviceOsMaxFileSize |
debug/device-os目录下单个device-os_*.log日志文件的大小,当日志文件大小超过该值时,则生成新的日志文件。
说明:
您可以根据实际情况调整大小,如果设置值小于1MB,系统默认为1MB。 |
DeviceOsNdebugMaxFileNum |
run/operation/security的device-os目录下保存device-os_*.log日志文件的数量,当日志文件数目大于该数目时发生滚动,新日志覆盖最早的日志。 |
DeviceOsNdebugMaxFileSize |
run/operation/security的device-os目录下单个device-os_*.log日志文件的大小,如果日志文件大小超过该最大值,则生成新的日志文件。
说明:
您可以根据实际情况调整大小,如果设置值小于1MB,系统默认为1MB。 |
DeviceMaxFileNum |
device-id目录下保存device-id_*.log日志文件的数量,当日志文件数目大于该数目时发生滚动,新日志覆盖最早的日志。 |
DeviceMaxFileSize |
device-id目录下单个device-id_*.log日志文件的大小,当日志文件大小超过该值时,则生成新的日志文件。
说明:
您可以根据实际情况调整大小,如果设置值小于1MB,系统默认为1MB。 |
DeviceAppDirNums |
保存device-app-pid目录的数量。 |
DeviceAppMaxFileNum |
每个device-app-pid目录下保存device-app-pid_*.log日志文件的数量,当device-app-pid_*.log日志文件数目大于该数目时发生滚动,新日志覆盖最早的日志。
说明:
对于推理场景(Ascend EP),仅当Device侧应用类日志回传到Host侧失败时,才会在Device侧存储device-app-pid_*.log日志。 |
DeviceAppMaxFileSize |
每个device-app-pid目录下单个device-app-pid_*.log日志文件的大小,当device-app-pid_*.log日志文件大小超过该值时,则生成新的日志文件。 |
LogBufSize |
系统&应用日志(device-os_*.log和device-app-pid_*.log)缓存大小。 |
logAgentFileDir |
日志文件路径。如果修改该路径,需确保运行日志进程的用户对该路径有读写权限。 |
permission_for_all |
是否支持与slogd进程运行用户不同用户属组的其他用户启动APP后写日志。
|
StackCorePath |
Stackcore文件保存路径,默认路径为var/log/npu/coredump。 |