A log file can save debugging messages, logs and traps. After you configure the trap output function, traps can be saved in log files so that you can check device operating information from the log files later.
Traps can be saved in user log files and diagnostic log files. The system periodically saves information in the log buffer to a user log file (log.log) and a diagnostic log file (log.dblg), which are saved in the logfile folder. When the two log files exceed the specified size, the system compresses them into zip packages and names the compressed files date time.log.zip and date time.dblg.zip, for example, 2013-08-14.04-55-23.log.zip and 2013-09-05.05-15-23.dblg.zip. The saved information includes information about important operations such as a switch restart.
The system view is displayed.
A channel through which logs are output to a log file is specified.
By default, the device uses channel 9 to output logs to a log file.
The rule for outputting logs to the specified channel is configured.
By default, channel 9 is enabled to output traps and the lowest severity is debugging.
The log file size is set.
By default, the log file size is 8 MB.
If the size of a log file generated on the device exceeds the configured log file size, the system decompresses the log file into a zip file.
The maximum number of log files that can be saved is set.
By default, a maximum of 200 log files can be saved.
If the number of log files generated on the device exceeds the limit, the system deletes the oldest log file.
If the remaining flash memory space is less than 30 MB, earlier compressed log files are deleted. If no compressed log files can be deleted and the remaining flash memory space is less than 30 MB, no log files will be generated.
Logs in the log buffer are saved to a log file. To view current log information, run this command to save the logs in the log buffer to a log file.