Logs generated on the switch contain sequence numbers. That is, the log counter function is enabled by default. For example, you can run the display logbuffer command to view the sequence numbers of logs.
<HUAWEI> display logbuffer Logging buffer configuration and contents : enabled Allowed max buffer size : 1024 Actual buffer size : 512 Channel number : 4 , Channel name : logbuffer Dropped messages : 0 Overwritten messages : 5 Current messages : 512 Jul 17 2012 14:49:32 HUAWEI %%01IFPDT/4/IF_STATE(l)[0]:Interface Ether net5/0/23 has turned into UP state. Jul 17 2012 14:49:30 HUAWEI %%01IFPDT/4/IF_STATE(l)[1]:Interface Ether net5/0/23 has turned into DOWN state. Jul 17 2012 14:44:22 HUAWEI %%01IFPDT/4/IF_STATE(l)[2]:Interface Ether net5/0/23 has turned into UP state. Jul 17 2012 14:14:02 HUAWEI %%01SHELL/4/LOGINFAILED(l)[3]:Failed to lo gin. (Ip=10.138.123.123, UserName=**, Times=1, AccessType=TELNET) Jul 17 2012 11:15:03 HUAWEI %%01INFO/4/RST_LOGB(l)[4]:When deciding wh ether to reset the logbuffer, the user chose N. ……
If the Switch has been running for a long time, many logs may be generated.
If logs are sent to the console, log file, or terminal, logs are counted independently and sequence numbers in the logs are in ascending order. That is, the sequence number of the log that was generated first is 0 and the log that is generated later has a larger sequence number.
If logs are sent to the log buffer, sequence numbers in logs are in descending order. That is, the sequence number in the log that is generated recently is 0 and the log that was generated earlier has a larger sequence number.