[Contents] [Prev] [Next] [Index] [Report an Error]


Configuring Event Logging

By default, event logging is enabled and has default settings. This section shows how to change the following settings to customize event logging to fit your needs.

host1#baseline log 11:12:55 April 30 2002
host1(config)#log severity warning
host1(config)#log unlimit qos 
host1(config)#log verbosity log
host1(config)#log destination syslog 10.10.9.5 include 
ospfGeneral mplsGeneral os
host1(config)#log fields timestamp instance no-calling-task
host1#log here

The next sections show how to configure individual and systemwide logs, how to format timestamps for log messages, and how to configure log filters.

    baseline log

Hour:Minute[:Second] - current time in 24-hour format. Seconds are optional.

Month Day Year - you must spell out the name of the month.

host1#baseline log 11:12:55 April 30 2002
host1#baseline log last-reset

    log destination



Note: You can display traffic logs—such as ipTraffic, icmpTraffic, tcpTraffic, and udpTraffic—only via the show log data command or from the SRP module console. You cannot redirect traffic logs elsewhere, such as to a system log or nonvolatile storage file, or to a Telnet session.

host1(config)#log destination syslog 10.10.9.5 include 
ospfGeneral mplsGeneral os
host1(config)#no log destination syslog 10.10.9.5 
host1(config)#log destination syslog 10.10.9.5 include 
ospfGeneral mplsGeneral os
host1(config)#no log destination syslog 10.10.9.5 include 
ospfGeneral os
host1(config)#log destination syslog 10.1.2.3 exclude 
isisGeneral ipRoutePolicy ipTraffic
host1(config)#no log destination syslog 10.1.2.3 exclude 
host1(config)#log destination syslog 10.1.2.3 exclude 
isisGeneral ipRoutePolicy ipTraffic
host1(config)#no log destination syslog 10.1.2.3 exclude 
isisGeneral 
host1(config)#log destination syslog 10.1.2.3 exclude 
isisGeneral
host1(config)#log destination syslog 10.1.2.3 exclude 
ospfGeneral 
host1(config)#log destination syslog 10.1.2.3 exclude 
isisGeneral
host1(config)#log destination syslog 10.1.2.3 include 
ospfGeneral

    log destination syslog source

host1(config)#log destination syslog 10.1.2.3 source atm 0/1

    log engineering

host1(config)#log engineering

    log fields

host1(config)#log fields timestamp instance no-calling-task

    log here

host1#log here

    log severity

host1(config)#log severity warning
host1(config)#no log severity *

    log unlimit

host1(config)#log unlimit qos 

    log verbosity

host1(config)#log verbosity log

Configuring Log Severity for Individual and Systemwide Logs

Each event category has its own default severity setting that is based on the type of log messages for that category. You can change the severity setting for individual logs and the systemwide value:

Examples

The following example sets all logs to log at severity info, except for the bgpEvents and bgpRoutes categories.

host1(config)#log severity warning bgpEvents
host1(config)#log severity notice bgpRoutes
host1(config)#log severity info

The following command removes the severity values for bgpEvents; bgpEvents now logs at the info severity level.

host1(config)#no log severity bgpEvents

The following command returns all logs to their default severity level.

host1(config)#no log severity *

To see whether individual or systemwide severity and verbosity settings are in effect, use the show log configuration command.

Configuring Log Verbosity for Individual Logs or All Logs

The default verbosity setting for all logs is low. To change the logging verbosity of an individual log, specify a category when you enter the log verbosity command. To change the log verbosity of every log, do not specify an event category when you enter the log verbosity command. However, once you enter the log verbosity command without specifying a particular event category, all logs are set to the new verbosity. No log verbosity overrides are saved.

Example

The following example sets all log categories to verbosity medium, and then it sets the verbosity level for ds3 events to high.

host1(config)#log verbosity medium
host1(config)#log verbosity high ds3 

Setting the Timestamp for Log Messages

You can use the service timestamps command to format timestamps for log messages. By default, log messages display universal coordinated time (UTC) without the time zone.

The following examples illustrate how you can change the timestamp on log messages.

host1(config)#clock timezone EDT -5
host1(config)#service timestamps log datetime show-timezone 
localtime
host1#exit
host1#show log data category cliCommand severity info
***********************************************************
NOTICE 05/14/2001 13:22:48 EDT cliCommand: "clock timezone 
EDT -5", console
NOTICE 05/14/2001 13:23:03 EDT cliCommand: "service 
timestamps log datetime show-timezone localtime ", console
***********************************************************
host1(config)#service timestamps log datetime
host1#exit
host1#show log data category cliCommand severity info
***********************************************************
NOTICE 05/14/2001 18:24:49 cliCommand: "configure terminal", 
console
NOTICE 05/14/2001 18:24:45 cliCommand: "service timestamps 
log datetime", console
***********************************************************
host1#configure terminal
host1(config)#service timestamps log datetime show-timezone
host1(config)#exit
host1#show log data category cliCommand severity info
***********************************************************
NOTICE 05/14/2001 18:28:45 UTC EDT cliCommand: "configure 
terminal", console
NOTICE 05/14/2001 18:28:42 UTC EDT cliCommand: "service 
timestamps log datetime show-timezone", console
***********************************************************
host1#configure terminal
host1(config)#no service timestamps
host1#exit
host1#show log data category cliCommand severity info
***********************************************************
NOTICE 134 cliCommand: "configure terminal", console
NOTICE 133 cliCommand: "no service timestamps", console
***********************************************************

    service timestamps

Configuring Log Filters

Many event categories contain filters that let you further refine the type of information that the system logs. For example, when logging BGP connections, you can limit the information logged to a specific access class, peer, route map, or virtual router.

You define filters when you set the log severity for an event category. The online Help shows the options you can set for each filter. The following example creates a filter that logs BGP connection information at the debug severity level on traffic that matches access list ListOne, and is incoming traffic to virtual router default.

host1(config)#log severity debug bgpevents ?
  access-class  Select an access list for the filter
  in            Select import/in direction for the filter
  out           Select export/out direction for the filter
  peer          Select a peer IP address for the filter
  route-map     Select a route map for the filter
  router        Identify an instance of a virtual router
  <cr> 
host1(config)#log severity debug bgpevents access-class ?
  WORD  The access list

host1(config)#log severity debug bgpevents access-class 
ListOne ?
  filtering-router  Identify virtual router where 
access-class/route-map are defined
  in                Select import/in direction for the filter
  out               Select export/out direction for the filter
  route-map         Select a route map for the filter
  <cr> 

host1(config)#log severity debug bgpevents access-class 
ListOne route-map ?
  WORD  The route map

host1(config)#log severity debug bgpevents access-class 
ListOne route-map default ?
  filtering-router  Identify virtual router where 
access-class/route-map are defined
  in                Select import/in direction for the filter
  out               Select export/out direction for the filter
  <cr>

host1(config)#log severity debug bgpevents access-class 
ListOne route-map default in

The next example limits the logging of PPP debug events to traffic to or from the POS interface in slot 2/0.

host1(config)#log severity debug ppp ?
  atm              Specify an ATM PPP interface
  fastEthernet     Specify a fastEthernet interface
  gigabitEthernet  Specify a gigabitEthernet interface
  mlppp            Specify an MLPPP network interface
  pos              Specify a POS PPP interface
  serial           Specify a serial PPP interface
  <cr> 
host1(config)#log severity debug ppp pos 2/0

List of Event Categories, later in this chapter, includes the filters available in each event category.

Turning Off Filters

There are three ways to turn off filters. The first turns off all filters, the second lets you turn off all filters for an event category, and the third lets you turn off a specific filter.

To turn off all filters:

host1(config)#no log filters

To turn off all filters for an event category, use the no version of the log severity command along with the category name. For example:

host1(config)#no log severity bgpEvents filters

To turn off a specific filter, use the no version of the log severity command that you used to add the filter. For example:

host1(config)#no log severity bgpEvents peer 10.0.0.2 
10.0.0.1

    no log filters

host1(config)#no log filters 

[Contents] [Prev] [Next] [Index] [Report an Error]