6.3.a Local logging, syslog, debugs, conditional debugs

Local Logging

By default on IOS, all logging is displayed on the console.  This can be turned off with the no logging command.  To either turn it back on or to control the console logging, use the following:

Router(config)# logging console {level}

You can also specify the settings for the current SSH/Telnet setting with the command:

Router# terminal monitor

For local logging, Cisco IOS can save syslog messages to the internal buffer.  You can display these messages by the show logging command.  You can enable internal logging and the size of the buffer with this command:

Router(config)# logging buffered <size>


Syslog messages can be output to the console, local buffer or a remote syslog server.  The messages follow this format:


Each section has a specific meaning:

  • FACILITY-SUBFACILITY: Reports the protocol, module or process that generated the message.
  • SEVERITY:  This is a level from 0-7 that specifies how important the message is.  When you enable logging for a specific level, it also enables all of the levels above it.  For example, if you enable level 5 logging, it also will enable levels 0-4.  Here are the following levels:
    • 0 – Emergency
    • 1 – Alert
    • 2 – Critical
    • 3 – Error
    • 4 – Warning
    • 5 – Notice
    • 6 – Informational
    • 7 – Debugging
  • MNEMONIC:  A code that identifies the action reported
  • Message text: A plain text description of the event

To enable logging to a remote syslog server, use the following:

Router(config)# logging x.x.x.x


Debugs are useful tools when troubleshooting specific issues.  There are way too many debug commands to go over here, but you can view them by typing debug ? on the router.  To disable the current debug, just issue the same command with no preceding it.  You can also turn off all debugs with undebug all or u all for short.

The downside of debugs is that they can produce a huge amount of information, which may overload the router.  However, you can use a conditional debug to limit the information based on specific interface, or protocol.  For example, here is a conditional debug for interface s1/0:

Router# debug ip ospf packets
Router# debug condition interface s1/0
Router# show debug condition

6.3.b Timestamps

You can configure timestamps for your debugs or logs with the following:

Router(config)# service timestamps {debug | log}

You can further configure this by specifying which time to put on the end of the message.  For example you can add the local date and time to the message:

Router(config)# service timestamps log datetime localtime

Or you can add the total uptime of the router to the messages:

Router(config)# service timestamps debug uptime