How to collect logs on S series switches


The S series switches (except the S1700) support the storage of logs and alarms in log files.
You can run the dir command in the user view to view the log files, which are named syslogfile or logfile.
The syslogfile file is saved automatically every time the device restarts. The logfile file is automatically saved at regular intervals.
Run the save logfile command to save information in the log buffer to syslogfile or logfile.
In addition, if the system is faulty or under routine maintenance, you can run the display diagnostic-information [module-name] [ file-name ] command to view diagnosis information and check the running status of each module. In the command, file-name is the name of file that stores the diagnosis information.

You can perform the following steps to collect switch log files:
1. Run the save logfile command to save information in the log buffer to a log file.
2. Run the cd logfile command to access the directory where the log file is located.
3 Use FTP or TFTP to obtain the log.log and the log.dblg files from this directory.

For example, assume that the S series switch ( functions as the FTP client, and the PC ( functions as the FTP server. To upload the log.log and log.dblg files in the logfile directory of the switch to the PC, you must ensure that the switch and PC can communicate with each other and the FTP function is available.
Use FTP to access the PC from the S series switch:
cd logfile
ftp //Enter the FTP user name and password
put log.log
put log.dblg

Other related questions:
How to disable the timestamp in logs on S series switches
For S series switches (except the S1700), logs, traps and debug messages carry a timestamp by default to record the time when the message is generated. You can run the following commands in the system view to disable the timestamp in logs: - info-center timestamp log none - info-center timestamp trap none - info-center timestamp debugging none

Collect diagnostic information on s series switch
For S series switches except S1700 switches, you can run the display diagnostic-information command to collect and display current diagnosis information or store the information in a specified file.

Traffic statistics collection on S series switch
On S series switches (except S1700 switches), the statistic enable command in the traffic behavior view can be used to enable traffic statistics collection in the traffic behavior. To view the statistics about packets matching a traffic policy, enable the traffic statistics collection function. After the traffic statistics collection function is enabled, you can run the display traffic policy statistics command to view packet statistics. For the example for configuring traffic statistics, see "Example for Configuring Traffic Statistics" in Typical QoS Configuration.

How to collect logs of a CE series switch
Log information is save in four types of log files including the diag.log, log.log, diagnose.log (one-click logs), (memory logs) files.

To analyze software issues, collect log information in the diag.log, log.log, diagnose.log (one-click logs are the most important) files.

To analyze hardware issues, collect log information in the diag.log, log.log, (memory logs, which are the most important logs) files, and other related command lines.

Collect log information using either of the following methods:

1. Collect diagnostic logs in one click.

[~HUAWEI] diagnose
[~HUAWEI-diagnose] display diagnostic-information >> diagnose.log

1. Executing the command takes about 5 minutes. Please wait.
2. The diagnose.log file is exported to the root directory of the active MPU.

< HUAWEI >cd flash:
<~HUAWEI >dir

3. Collect log information in the diag.log, log.log, and files.

[~HUAWEI] diagnose
[~HUAWEI-diagnose] collect diagnostic information
[~HUAWEI-diagnose] return
<HUAWEI >save logfile
<HUAWEI > cd logfile:
<HUAWEI >dir

You can run the mput * command to collect all logs.
[ftp]mput *

3. Run the following command lines to collect information to analyze hardware issues.

display startup
display version
display alarm active
display alarm history verbose
display device alarm hardware
display device
display device canbus (CE12800 series switches)
display device power sy
display device elabel
display device power
display health
display device board reset all (in the diagnostic view in some versions)

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top