Configuration Guide Configuring Syslog
By default, the source address of logs sent to the log server is the IP address of the interface sending logs.
Run the logging source [ interface ] interface-type interface-number command to configure the source interface of logs. If
this source interface is not configured, or the IP address is not configured for this source interface, the source address of logs
is the IP address of the interface sending logs.
Run the logging source { ip ip-address | ipv6 ipv6-address } command to configure the source IP address of logs. If this IP
address is not configured on the device, the source address of logs is the IP address of the interface sending logs.
Writing Logs into Log Files
By default, logs are not written into log files. After the function of writing logs into log files is enabled, the level of logs written
into log files is informational (Level 6) by default.
Run the logging file flash:filename [ max-file-size ] [ level ] command in global configuration mode to configure parameters
for writing logs into log files, including the type of device where the file is stored, file name, file size, and log level.
Configuring the Interval at Which Logs Are Written into Log Files
By default, logs are written into log files at the interval of 3600s (one hour).
Run the logging flash interval seconds command in global configuration mode to configure the interval at which logs are
written into log files.
Configuring the Storage Time of Log Files
By default, the storage time is not configured.
Run the logging life-time level level days command in global configuration mode to configure the storage time of logs. The
administrator can specify different storage days for logs of different levels.
Immediately Writing Logs in the Buffer into Log Files
By default, syslogs are stored in the syslog buffer and then written into log files periodically or when the buffer is full.
Run the logging flash flush command in global configuration mode to immediately write logs in the buffer into log files so
that you can collect logs conveniently.
7.3.4 Syslog Filtering
By default, logs generated by the system are sent in all directions.
Working Principle
Filtering Direction
Five log filtering directions are defined:
buffer: Filters out logs sent to the log buffer, that is, logs displayed by the show logging command.
file: Filters out logs written into log files.
server: Filters out logs sent to the log server.