Logging

4.3.c i Local logging, syslog, debugs, conditional debugs

Local logging, syslog

General information on “Local logging, syslog”:

Logging severity levels:

Mnemonic:

Every Alley Cat Eats Warm Noodles In Doors

Log message format:

seq no:timestamp: %facility-severity-MNEMONIC:description

“Local logging, syslog” CLI configuration commands:

## Disabling/Enabling logging for console/VTY lines globally
Router(config)# [no] logging console
Router(config)# [no] logging monitor

## Defining the logging severity for console/VTY lines
Router(config)# logging console <severity>
Router(config)# logging monitor <severity>

## Defining the logging buffer size
Router(config)# logging buffered <size>

## Defining a syslog server (both commands do the same)
Router(config)# logging <syslog-srv-ip>
Router(config)# logging host <syslog-srv-ip>

## Setting logging to write messages to a file in the flash memory
Router(config)# logging file flash:<filename>

## Enabling logging on the VTY line (needs to be done after every login)
Router# terminal monitor

“Local logging, syslog” CLI show commands:

## Showing all log messages
Router# show logging

Debugs, conditional debugs

General information on “Debugs, conditional debugs”:

“Debugs, conditional debugs” CLI configuration commands:

## Enabling debugging for specific features and conditions
Router# debug [all | specific feature]
Router# debug condition [condition]

## Disabling debugging for specific features and conditions
Router# undebug [all | specific feature]
Router# undebug condition [condition]

“Debugs, conditional debugs” CLI show commands:

## Showing enabled debug parameters and conditions
Router# show debug
Router# show debug condition

4.3.c ii Timestamps

General information on “Logging Timestamps”:

“Logging Timestamps” CLI show commands:

## Enabling the timestamp service globally (with time since uptime)
Router(config)# service timestamps [log | debug] uptime

## Enabling the timestamp service globally (with actual date/time)
Router(config)# service timestamps [log | debug] datetime [msec | year | localtime  | show-timezone]

## Enabling the sequence numbers service globally
Router(config)# service sequence-numbers