There are 5 types of Cisco routers logs:
- Console logging:By default, the router sends all log messages to its console port. Hence only the users that are physically connected to the router console port can view these messages.
- Terminal logging:It is similar to console logging, but it displays log messages to the router's VTY lines instead. This is not enabled by default
- Buffered logging:This type of logging uses router's RAM for storing log messages. buffer has a fixed size to ensure that the log will not deplete valuable system memory. The router accomplishes this by deleting old messages from the buffer as new messages are added.
- Syslog Server logging :The router can use syslog to forward log messages to external syslog servers for storage. This type of logging is not enabled by default.
- SNMP trap logging:The router is able to use SNMP traps to send log messages to an external SNMP server.
Sample router log messages have 7 levels:
In global configuration mode, you can enable/disable console, buffered and syslog server logging.
You can optionally set the log size for buffered logging.
When setting up syslog server logging, you need to set the ip of the remote server that collect your syslog. Optionally, you can enables a source interface for the remote syslog server.
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#logging console informational
Router(config)#logging buffered informational
Router(config)#logging trap informational
Router(config)#logging buffered 64000 (optionally set buffer size for buffered logging)
Router(config)#logging host 126.96.36.199 (set host ip for syslog server logging)
Router(config)#logging source-interface Loopback0 (Enables a source interface for the remote syslog server)
Router(config)#no logging host 188.8.131.52 (un-set host ip for syslog server logging)
Router(config)#no logging console
Router(config)#no logging buffered
Router(config)#no logging trap
For terminal logging, use the terminal monitor command in privileged EXEC mode:
Router#terminal no monitor
Use the clear logging command to clear the router's internal log buffer:
Clear logging buffer [confirm]<enter>
To display the state of system logging (syslog) and the contents of the standard system logging message buffer, use the show logging command.