Restricting What Log Messages Are Sent to the Server
Problem
You want to limit which logging levels the router will send to the syslog server.
Solution
Use the logging trap configuration command to limit the severity level of syslog messages:
Router#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router(config)#logging hostRouter(config)#172.25.1.1logging trapRouter(config)#notificationsendRouter#
Discussion
By default, when you enable remote logging on a router, it will forward only those messages with a severity level informational or higher (see Table 18-1). This means that the router forwards everything but debugging messages to the syslog server. Raising the severity of the log messages forwarded to the syslog server can help to reduce bandwidth utilization across the network, as well as the disk space required for storing the log messages on the server. This example shows the output of the show logging exec command:
Router>show loggingSyslog logging: enabled (0 messages dropped, 0 messages rate-limited, 0 flushes, 0 overruns) Console logging: level debugging, 658 messages logged Monitor logging: level debugging, 65 messages logged Buffer logging: level debugging, 6 messages logged Logging Exception size (4096 bytes)Trap logging: level notifications,662 message lines logged Logging to 172.25.1.1, 5 message lines logged Logging to 172.25.1.3, 5 message lines logged Log Buffer (4096 bytes): Router>
Notice that the logging severity level is set ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access