Configuration method of router log information record

Source: Internet
Author: User

Date and timestamp of router log information

The default message does not include the date and timestamp, which is useful when determining the log time:

 
 
  1. hostname(config)#service timestamps {debug | log} uptime  
  2.  
  3. hostname(config)#service timestamps {debug | log} datetime [msec] [localtime] [show-timezone] [year] 

You can add two timestamps to the log message. When the uptime parameter is used, the time since the device was started is added to the log information, as shown below:

 
 
  1. 2w1d: %SYS-5-CONFIGJ: Configured from console by console 

Indicates that when the log is sent, the router starts for 2 weeks and 1 day.

When the datetime parameter is used, the date and time in UTC format are added to the log message. The standard format is mmm dd hh: MM: SS. There are other parameters in the datetime option. The msec parameter makes the log information time contain milliseconds, and the local-time indicates the time in the log information to use the local time of the router, show-timezone indicates that the time zone message is displayed in the log information, and year indicates that the year information is displayed in the log information. The following example uses these parameters:

 
 
  1. .Feb 4 2009 11:11:24 UTC: %SYS-5-CONFIGJ: Configured from console by console 

Serial Number of router log information

In addition to adding timestamp tags to log messages, you can also add serial numbers to log information. You can use the following command:

 
 
  1. hostname(config)#service sequence-numbers 

The following is an example of log information that is opened at both the timestamp and serial number:

 
 
  1. 000121: .Feb 4 2009 11:11:24 UTC: %SYS-5-CONFIGJ: Configured from console by console 

In this example, if the serial number is 121, it indicates that this is the 121 message to be logged.

Speed limit of router log information

We can use the logging rate-limit command to limit the log information record speed in seconds:

 
 
  1. hostname(config)#logging rate-limit {number | all number | console number} [except severity] 

By default, no restrictions are configured on the vro. You can specify a number to limit the number of logs recorded per second. The all keyword enables the speed limit command to act on log information and debugging information. The console parameter limits the speed at which logs are sent to the console. The expires t parameter creates an exception for a specified message severity level or higher level.

The commands for other log information in the vro log are described. We hope that you can understand and understand the preceding commands.

Edit recommendations]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.