- System Architecture
- Cisco IOS CLI
- Debugging and Logging
- Reloading and Upgrading
- Summary
- Review Questions
- For More Information
Debugging and Logging
Cisco IOS software allows for detailed debugging for all protocols and processes running in the system for troubleshooting purposes. More information on debugging can be obtained in the Cisco IOS Debug Command Reference, available on http://www.cisco.com.
CAUTION
Only Cisco IOS experts should enable and disable debug commands, because they can have a severe performance impact and should be used with care. Improper use might leave the system inaccessible and in a frozen state in which no packet forwarding takes place.
System messages are shown on the console and can be enabled for any session into the router. Different levels of severity can be configured for different access methods into the router. The eight message severity levels are as follows:
Emergency (severity 0)The system is unusable
Alert (severity 1)Immediate action is needed
Critical (severity 2)Critical condition
Error (severity 3)Error condition
Warning (severity 4)Warning condition
Notification (severity 5)Normal but significant condition
Informational (severity 6)Informational message
Debugging (severity 7)Debugging message
The logging command directs the output to various terminals attached to the system or virtually connected, such as Telnet sessions. Example 4-3 shows how the logging command can be used to determine the severity level of the messages shown.
Example 4-3 logging Command
IOS(config)# logging ? Hostname or A.B.C.D IP address of the logging host buffered Set buffered logging parameters console Set console logging level exception Limit size of exception flush output facility Facility parameter for syslog messages history Configure syslog history table host Set syslog server host name or IP address monitor Set terminal line (monitor) logging level on Enable logging to all supported destinations rate-limit Set messages per second limit source-interface Specify interface for source address in logging transactions trap Set syslog server logging level IOS(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) <cr>
Enabling a higher level of messages shows all lower-level messages as well. The debugging level, or level 7, shows all messages. System messages may also be buffered and seen using the show logging command in privileged mode. A user may also send logging messages to a syslog server using the logging host command in configuration mode. A syslog server can be configured on a UNIX device or PC to accept these messages from a router and place them in a file. This allows for large files containing system messages to be maintained, because you are not restricted by the amount of memory on the router.