< Home

(Optional) Disabling the Log Counter Function

Context

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.

  • To enable the Switch not to encapsulate sequence numbers in logs sent to the log buffer, log file, console, or terminal, disable the log counter function.
  • To re-collect statistics on logs sent to the log buffer, log file, console, or terminal, disable the log counter function, and then enable the log counter function.
  • To view logs sent to the log buffer, log file, console, or terminal, disable the log counter function, enable the log counter function so that logs contain sequence numbers in ascending order.
  • 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.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Run info-center local log-counter disable

    The log counter function is disabled.

    By default, the log counter function is enabled.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >