GTAC-Sophia Publish time 2023-6-26 11:34:37

How to set up AC&AP to save system logs to flash?

Requirements
Save the log to and print it out.
Configuration Tips
1) You can specify the name of the log file. In general, you do not need to add file name extension.
2) You can specify the size of the file. The default is 128KB, if more than, then generate multiple files to save, with increasing numbers, such as mylog_1, mylog_2, mylog_3, up to 16 files.
3) You can specify which levels of logs to save to the flash. By default, all levels 0 to 6 are saved.
4) You can configure the size of the log memory cache. The default value is 1MB. In this way, the system will save the logs that exceed the cache space to flash.
Configuration Steps
1. Save the log to flash
Ruijie#conf
Ruijie(config)#logging file flash:filename
data/attachment/forum/202306/26/113239fxz5m9099m795p8x.png


filename:
Log file name. The log file name does not contain a file type suffix. The suffix of the log file is fixed to *.txt. The suffix of the configuration file is rejected.
max-file-size:
The maximum size of log files is specified, range is 131072-6291456.
level:
The severity level of a log increases gradually. Level 0 to 6 indicates log information. Level 7 indicates debug information.
data/attachment/forum/202306/26/113253jicjxx1p1csac1ja.png


Ruijie(config)#logging buffered
data/attachment/forum/202306/26/113307n2u2z2o5qcaoq2q2.png
2. How to check logs saved to the flash:

Ruijie#dir
data/attachment/forum/202306/26/113405a5ymj00m5mrbcmy7.png

3. How to print log information:
Ruijie#more flash:log.txt
data/attachment/forum/202306/26/113412proagieikd8dikoy.png


Pages: [1]
View full version: How to set up AC&AP to save system logs to flash?