
249
Outputting logs to the log buffer
Step Command
Remarks
1.
Enter system view.
system-view
N/A
2.
Enable the information center.
info-center enable
By default, the information center is
enabled.
3.
Enable log output to the log
buffer.
info-center logbuffer
By default, log output to the log
buffer is enabled.
4.
(Optional.) Set the maximum
number of logs that can be
stored in the log buffer.
info-center
logbuffer
size
buffersize
By default, the log buffer can store
512 logs.
5.
Configure an output rule for
the log buffer.
info-center source
{
module-name
|
default
}
{
console
|
monitor
|
logbuffer
|
logfile
|
loghost
}
{
deny
|
level
severity
}
For information about default
output rules, see "
."
6.
(Optional.) Configure the
timestamp format.
info-center timestamp
{
boot
|
date
|
none
}
By default, the timestamp format is
date
.
Saving logs to a log file
By default, the log file feature saves logs from the log file buffer to a log file every 24 hours. You can
adjust the saving interval or manually save logs to a log file. After saving logs to a log file, the system
clears the log file buffer.
The device supports multiple log files. Each log file has a maximum capacity. The log files are named as
logfile1.log
,
logfile2.log
, and so on. When the maximum capacity of
logfile1.log
is reached, the system
compresses
logfile1.log
as
logfile1.log.gz
and creates a new log file named
logfile2.log
. You can
download the compressed log files. When the last log file is full or the storage device runs out of space,
the system deletes the oldest log file and creates a new one.
You can enable log file overwrite-protection to stop the device from saving new logs when the last log file
is full or the storage device runs out of space.
To save logs to a log file:
Step Command
Remarks
1.
Enter system view.
system-view
N/A
2.
Enable the information center.
info-center enable
By default, the information center is
enabled.
3.
Enable the log file feature.
info-center logfile enable
By default, the log file feature is
enabled.
4.
(Optional.) Enable log file
overwrite-protection.
info-center logfile
overwrite-protection
[
all-port-powerdown
]
By default, log file
overwrite-protection is disabled.
This feature is supported only in
FIPS mode.