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


Configuring Event Logging

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

The next sections explain 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.

log destination

log destination syslog source

log engineering

log fields

log here

log severity

log unlimit

log verbosity

Configuring Log Severity for Individual and Systemwide Logs

You can change the severity setting for individual logs and the systemwide value.

When working with log severities, keep the following in mind:

Example

The following example demonstrates the effects of event category state in regard to using systemwide commands:

  1. In Configuration mode and having made no changes to the severity settings of any event categories, view the log configuration:
  2. host1(config)#run show log config
    
        log destination console severity WARNING
    
        log destination nv-file severity CRITICAL
    
        log destination syslog 10.10.4.240 facility 7 severity DEBUG
    
        no log engineering
    
        log fields timestamp instance no-calling-task
    
        no log here
    
    
    
    Warning: Logging to this terminal is disabled
    
        no log severity
    
    
    
          category         severity   verbosity   filters   notes
    
    --------------------   --------   ---------   -------   -----
    
    aaaAtm1483Cfg          ERROR      low
    
    aaaEngineGeneral       ERROR      low
    
    aaaServerGeneral       ERROR      low
    
    aaaUserAccess          ERROR      low
    
    addressServerGeneral   ERROR      low
    
    ar1AaaServerGeneral    ERROR      low
    
    atm                    ERROR      low
    
    atm1483                ERROR      low
    
    atmAal5                ERROR      low 
    
    
    

Notice that the atm event category has a default severity of Error.

  1. Change all event categories to Warning, systemwide, and view the log configuration:
  2. host1(config)#log severity warning
    
    host1(config)#run show log config
    
        log destination console severity WARNING
    
        log destination nv-file severity CRITICAL
    
        log destination syslog 10.10.4.240 facility 7 severity DEBUG
    
        no log engineering
    
        log fields timestamp instance no-calling-task
    
        no log here
    
    
    
    Warning: Logging to this terminal is disabled
    
        log severity WARNING
    
    
    
          category         severity   verbosity   filters   notes
    
    --------------------   --------   ---------   -------   -----
    
    aaaAtm1483Cfg          WARNING    low                   1
    
    aaaEngineGeneral       WARNING    low                   1
    
    aaaServerGeneral       WARNING    low                   1
    
    aaaUserAccess          WARNING    low                   1
    
    addressServerGeneral   WARNING    low                   1
    
    ar1AaaServerGeneral    WARNING    low                   1
    
    atm                    WARNING    low                   1
    
    atm1483                WARNING    low                   1
    
    atmAal5                WARNING    low                   1 
    
    
    
  3. Change the atm category to have a log severity of Emergency and view the log configuration:
  4. host1(config)#log severity emergency atm
    
    host1(config)#run show log config
    
        log destination console severity WARNING
    
        log destination nv-file severity CRITICAL
    
        log destination syslog 10.10.4.240 facility 7 severity DEBUG
    
        no log engineering
    
        log fields timestamp instance no-calling-task
    
        no log here
    
    
    
    Warning: Logging to this terminal is disabled
    
        log severity WARNING
    
    
    
    category               severity   verbosity   filters   notes
    
    --------------------   --------   ---------   -------   -----
    
    aaaAtm1483Cfg          WARNING     low                   1
    
    aaaEngineGeneral       WARNING     low                   1
    
    aaaServerGeneral       WARNING     low                   1
    
    aaaUserAccess          WARNING     low                   1
    
    addressServerGeneral   WARNING     low                   1
    
    ar1AaaServerGeneral    WARNING     low                   1
    
    atm                    EMERGENCY   low                   2
    
    atm1483                WARNING     low                   1
    
    atmAal5                WARNING     low                   1 
    
    
    
  5. Change all event categories to Alert, systemwide, and view the log configuration:
  6. host1(config)#log severity alert
    
    host1(config)#run show log config
    
        log destination console severity WARNING
    
        log destination nv-file severity CRITICAL
    
        log destination syslog 10.10.4.240 facility 7 severity DEBUG
    
        no log engineering
    
        log fields timestamp instance no-calling-task
    
        no log here
    
    
    
    Warning: Logging to this terminal is disabled
    
        log severity ALERT
    
    
    
    category               severity   verbosity   filters   notes
    
    --------------------   --------   ---------   -------   -----
    
    aaaAtm1483Cfg          ALERT       low                   1
    
    aaaEngineGeneral       ALERT       low                   1
    
    aaaServerGeneral       ALERT       low                   1
    
    aaaUserAccess          ALERT       low                   1
    
    addressServerGeneral   ALERT       low                   1
    
    ar1AaaServerGeneral    ALERT       low                   1
    
    atm                    EMERGENCY   low                   2
    
    atm1483                ALERT       low                   1
    
    atmAal5                ALERT       low                   1 
    
    
    

Notice that the atm event category that you individually assigned in Step 3 does not change.

  1. Turn off log notification, systemwide, and view the log configuration:
  2. host1(config)#log severity off
    
    host1(config)#run show log config
    
        log destination console severity WARNING
    
        log destination nv-file severity CRITICAL
    
        log destination syslog 10.10.4.240 facility 7 severity DEBUG
    
        no log engineering
    
        log fields timestamp instance no-calling-task
    
        no log here
    
    
    
    Warning: Logging to this terminal is disabled
    
        log severity OFF
    
    
    
          category         severity    verbosity   filters   notes
    
    --------------------   ---------   ---------   -------   -----
    
    aaaAtm1483Cfg          OFF         low                   1
    
    aaaEngineGeneral       OFF         low                   1
    
    aaaServerGeneral       OFF         low                   1
    
    aaaUserAccess          OFF         low                   1
    
    addressServerGeneral   OFF         low                   1
    
    ar1AaaServerGeneral    OFF         low                   1
    
    atm                    EMERGENCY   low                   2
    
    atm1483                OFF         low                   1
    
    atmAal5                OFF         low                   1 
    
    
    

Notice that the atm event category does not change.

  1. Remove the assigned status of the atm event category and view the log configuration:
  2. host1(config)#no log severity atm
    
    host1(config)#run show log config
    
        log destination console severity WARNING
    
        log destination nv-file severity CRITICAL
    
        log destination syslog 10.10.4.240 facility 7 severity DEBUG
    
        no log engineering
    
        log fields timestamp instance no-calling-task
    
        no log here
    
    
    
    Warning: Logging to this terminal is disabled
    
        log severity OFF
    
    
    
          category         severity   verbosity   filters   notes
    
    --------------------   --------   ---------   -------   -----
    
    aaaAtm1483Cfg          OFF        low                   1
    
    aaaEngineGeneral       OFF        low                   1
    
    aaaServerGeneral       OFF        low                   1
    
    aaaUserAccess          OFF        low                   1
    
    addressServerGeneral   OFF        low                   1
    
    ar1AaaServerGeneral    OFF        low                   1
    
    atm                    OFF        low                   1
    
    atm1483                OFF        low                   1
    
    atmAal5                OFF        low                   1 
    
    
    

Notice that the atm event category follows the systemwide severity level of OFF. The systemwide setting takes precedence over the atm event category default of Error.

  1. Change all event categories, systemwide, to their default/unassigned levels, and view the log configuration:
  2. host1(config)#no log severity *
    
    Please wait....
    
    host1(config)#run show log config
    
        log destination console severity WARNING
    
        log destination nv-file severity CRITICAL
    
        log destination syslog 10.10.4.240 facility 7 severity DEBUG
    
        no log engineering
    
        log fields timestamp instance no-calling-task
    
        no log here
    
    
    
    Warning: Logging to this terminal is disabled
    
        no log severity
    
    
    
          category         severity   verbosity   filters   notes
    
    --------------------   --------   ---------   -------   -----
    
    aaaAtm1483Cfg          ERROR      low
    
    aaaEngineGeneral       ERROR      low
    
    aaaServerGeneral       ERROR      low
    
    aaaUserAccess          ERROR      low
    
    addressServerGeneral   ERROR      low
    
    ar1AaaServerGeneral    ERROR      low
    
    atm                    ERROR      low
    
    atm1483                ERROR      low
    
    atmAal5                ERROR      low 
    

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, after 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.

service timestamps

Configuring Log Filters

Many event categories contain filters so you can 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.

NOTE: You can use the packet flow monitoring feature to create user-defined classification parameters that specify the packet data that is logged. See Packet Tagging Overview in JUNOSe Policy Management Configuration Guide, Chapter 4, Creating Classifier Groups and Policy Rules.


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

To obtain a list of the filters available in each event category, see Chapter 2, Event Categories.

Turning Off Filters

You can turn off filters in three ways:

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


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