Saving system information to a log file – H3C Technologies H3C SR8800 User Manual

Page 196

Advertising
background image

184

Saving system information to a log file

With the log file feature enabled, the log information generated by system can be saved to a specified

directory with a predefined frequency. This allows you to check the operation history at any time to make

sure that the router functions properly.
Logs are saved into the logfile buffer before they are saved into a log file. The system writes the logs in

the logfile buffer into the log file at a specified frequency, which is usually set to 24 hours and during a

relatively free time, in mornings for example. You can also manually save the logs. After the logs in the

logfile buffer are saved into the log file successfully, the system clears the logfile buffer.
A log file has capacity limitations. When the size of a log file reaches the maximum value:

If the router only supports a single log file, the system will delete the earliest message(s)and write
new message(s) into the log file. The directory of a log file varies with the router models. Typically,

a log file is saved in the directory /logfile/logfile.log.

If the device supports multiple log files, the system will create new log files to save new messages.
The new log files will be named as logfile1.log, logfile2.log, and so on. When the number of log

files reaches the upper limit, or the storage media has no space available, the system will delete the

earliest log file and create a new one.

To set to save system information to a log file:

Step Command

Remarks

1.

Enter system view.

system-view

N/A

2.

Enable information
center.

info-center enable

Optional.
Enabled by default.

3.

Enable the log file

feature.

info-center logfile enable

Optional.
Enabled by default.

4.

Configure the frequency
with which the log file is

saved.

info-center logfile frequency
freq-sec

Optional.
The default value is 60 seconds.

5.

Configure the maximum
storage space reserved

for a log file.

info-center logfile size-quota
size

Optional.
The default value is 10 MB.

6.

Configure the directory to

save the log file.

info-center logfile
switch-directory dir-name

Optional.
By default, it is the logfile directory under

the root directory of the memory device,
which varies with routers.

7.

Manually save the log
buffer content to the log

file.

logfile save

Optional.
Available in any view.
By default, the system saves the log file with

the frequency defined by the info-center
logfile frequency command.

Advertising