Sending Log Messages to Your Screen

Problem

You want the router to display log messages to your VTY session in real time.

Solution

Use the terminal monitor command to enable the displaying of log messages to your VTY:

Router#terminal monitor 
Router#

To disable logging to your VTY session, use the following command:

Router#terminal no monitor
Router#

Discussion

Routers forward all logging messages to their console ports by default, but not to their VTY lines. When you are troubleshooting a network problem on a remote router, it is often quite useful to instruct the router to send log messages to your VTY so that you can view them in real time. Here is an example showing how to configure the router to display messages with informational severity level and greater (see Table 18-1 for more information about logging severity levels) to VTY lines:

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#logging monitor informational 
Router(config)#exit
Router#terminal monitor
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#interface Fastethernet0/0
Router(config-subif)#shutdown
Router(config-subif)#exit
Router(config)#end
Router#
Mar 26 09:36:43: %LINK-5-CHANGED: Interface Fastethernet0/0, changed state to administratively down

This example changes the logging monitor level to informational, enables terminal monitoring and then changes the state of an interface to trigger a sample log message. By ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.