In a router or a switch logging is used to record what is going on the device. In Cisco devices, logging is also use for this purpose. In this lesson, we will focus on two important commands related with logging. These are Cisco terminal monitor command and Cisco logging monitor command. You can also check Cisco debug commands lesson.
By default, on Cisco devices, logging is turned on. You do not need to turn on it. So, when you are in router or switch CLI with a Console connection, you receive these log messages. But if you are connection to the device with Telnet or SSH, these logs are not displayed by default.
This log message can be displayed like below:
%LINEPROTO-5-UP: Line protocol on Interface GigabitEthernet0/1, changed state to up
This message shows that GigabitEthernet0/1 is up.
Here, we have learned how to use Cisco Debug Command on Cisco routers and switches. Debugging is very important for network troubleshooting but you whould be careful while using these commands.
Table of Contents
Terminal monitor Cisco command is used to turn off debug output through SSH and Telnet access. As we have mentioned above, it is already turned on in Console connection. To do this we use “terminal monitor” command on Cisco routers and switches.
What is displayed with terminal monitor Cisco command? Any debug messages like events and errors are displayed with Cisco terminal monitor command.
Router# terminal monitor
To disable this on Cisco routers and switches, we use “terminal no monitor” command. Here, be careful the place of no keyword. Not at the beginning but in the middle of the command.
Router# terminal no monitor
This is how we use terminal monitor Cisco command.
Here, another important command is Cisco logging monitor command. With Cisco logging monitor command, we enable displaying system message logs on terminal. We can define different system message levels with Cisco logging monitor command.
There are 8 debugging levels or syslog levels from 0 to 7. These syslog levels are given below:
By default, all levels are displayed with logging monitor command. But we can specify a level and then any message on this level and lower-level messages are displayed. For example, if we use “logging monitor 3“ command we display level 1,2,3 messages.
Router# logging monitor 3
To disable logging monitor, we use “no logging monitor” command on Cisco routers and switches.
Router# no logging monitor
This is how we use logging monitor Cisco command.
When you are working with a Cisco switch or a Cisco router, logs flows can cut your commands. This can cause wrong configurations and it is not a desired thing. To overcome this, we use Cisco logging synchronous command. When we use Cisco logging synchronous command, while you are writing commands, logs are not printed on the screen. After you complete the command, log is printed. This provides not breaking your configuration commands with logs.
Router# configure terminal
Router(config)# line console 0
Router(config-line)# logging synchronous
These Cisco terminal monitor command and Cisco logging monitor command are important commands for troubleshooting on Cisco routers and switches. AS a network engineer, you will use these commands for your network troubleshooting too much. So, having practice on these commands are important.