How to Control Console and Terminal Logging in Cisco Router and Switches

You might have experienced that while you are typing a command on a terminal, some stuff get thrown to the terminal be the router or the switch making it a mess. This stuff can be useful specially when you are configuring a routing protocol or changing setting on an interface. However mssages like the following, is quite disturbing when you are doing some task.

 

Router(config)#
Router#show
*Mar  1 00:07:23.487: %SYS-5-CONFIG_I: Configured from console by 
consolerun
Building configuration...

Current configuration : 694 bytes
!
version 12.3
…

 

Above terminal output is a good example. A message has been thrown in between me “show run” command. The router understood the command perfectly, but it we cat read it clearly. The reason for this is logging. Routers and switches use console ports to log messages. You can three options to stop or minimize the logging disturbances on terminals.

1. Disable Logging Completely This method is quite straight forward and you’ll loose the ability to see what’s going on in the router while you are configuring. You might want to know when a network interface goes up or down, neighbor relationship formation, etc. So this is the least useful method, but you do not get any messages on your console.

Router(config)#no logging console

2. Configure Logging Levels Cisco routers, switches, PIX and ASA firewalls prioritize log messages into 8 levels.

Level	Level Name		Description
0  	Emergencies  		System is unusable
1 	Alerts 			Immediate action needed
2 	Critical 		Critical conditions
3 	Errors 			Error conditions
4 	Warnings 		Warning conditions
5 	Notifications 		Informational messages
6 	Informational 		Normal but significant conditions
7 	Debugging 		Debugging messages

Log messages with lower numbers are more critical than higher numbers. If you specify a level, let say Warnings all the messages belong to that level and above (lower numbers) are logged for you.

Router(config)#logging console ?
  <0-7>          Logging severity level
  alerts         Immediate action needed           (severity=1)
  critical       Critical conditions               (severity=2)
  debugging      Debugging messages                (severity=7)
  emergencies    System is unusable                (severity=0)
  errors         Error conditions                  (severity=3)
  guaranteed     Guarantee console messages
  informational  Informational messages            (severity=6)
  notifications  Normal but significant conditions (severity=5)
  warnings       Warning conditions                (severity=4)
  xml            Enable logging in XML
  

Router(config)#logging console

You can either specify the number or the name of the level. Here I have configured it to show me warning on the console.

Router(config)#logging console warnings

This does the same as the above command. Router(config)#logging console 4 You can do the same for VTY terminals. Use logging monitor instead of logging console in global configuration mode

Router(config)#logging monitor ?
  <0-7>          Logging severity level
  alerts         Immediate action needed           (severity=1)
  critical       Critical conditions               (severity=2)
  debugging      Debugging messages                (severity=7)
  emergencies    System is unusable                (severity=0)
  errors         Error conditions                  (severity=3)
  informational  Informational messages            (severity=6)
  notifications  Normal but significant conditions (severity=5)
  warnings       Warning conditions                (severity=4)
  xml            Enable logging in XML
   

3. Logging Synchronous In Synchronous logging, after the message is thrown in to the terminal, router displays the original prompt with what you have already typed. To enable synchronous logging on console ports:

Router#
Router#conf t
Router(config)#line console 0
Router(config-line)#logging synchronous

To enable logging synchronous on telnet terminals:

Router#
Router#conf t
Router(config)#line vty 0 4
Router(config-line)#logging synchronous

Now the out put is like this.

Router(config)#
Router#show run
*Mar  1 01:44:37.067: %SYS-5-CONFIG_I: Configured from console
 by console
Router#show run

The router has repeated the prompt with that we have typed. You can get good results be combining the second and third methods wisely. Please see Cisco documentations for more on logging.

Dharshin


Tags:
Nice article

Nice article

Submitted by JD (not verified) on Thu, 06/19/2008 - 01:54.
Thanks.Your blog is useful.

Thanks.Your blog is useful.

Submitted by recykling (not verified) on Wed, 06/11/2008 - 13:00.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Translate

Syndicate

Syndicate content

Admin Login

Subscribe

Subscribe

Recent comments