Configure logging parameters to save information in a log file or direct the messages to other devices. Logging does the following:
Logs can be configured in the following contexts:
The most basic log configuration must have the following:
The following displays a log configuration example for the 7750 SR.
The following sections describe basic system tasks that must be performed.
A event log file contains information used to direct events, alarms, traps, and debug information to their respective destinations. One or more event sources can be specified. File IDs, SNMP trap groups, or syslog IDs must be configured before they can be applied to an event log ID.
Use the following CLI syntax to configure a log file:
The following displays a log file configuration example:
To create a log file a file ID is defined, specifies the target CF drive, and the rollover and retention interval period for the file. The rollover interval is defined in minutes and determines how long a file will be used before it is closed and a new log file is created. The retention interval determines how long the file will be stored on the CF before it is deleted.
When creating new log files in a compact flash disk card, the minimum amount of free space is the MINIMUM of 10% of Compact Flash disk capacity OR 5Mb (5,242,880 = 5 * 1024 * 1024).
The following displays a log file configuration example:
Before an accounting policy can be created a target log file must be created to collect the accounting records. The files are stored in system memory of compact flash (cf1: or cf2:) in a compressed (tar) XML format and can be retrieved using FTP or SCP. See Configuring an Event Log and Configuring a File ID.
Accounting policies must be configured in the config>log context before they can be applied to a service SAP or service interface, or applied to a network port.
The default accounting policy statement cannot be applied to LDP nor RSVP statistics collection records.
An accounting policy must define a record type and collection interval. Only one record type can be configured per accounting policy.
When creating accounting policies, one service accounting policy and one network accounting policy can be defined as default. If statistics collection is enabled on a SAP or network port and no accounting policy is applied, then the respective default policy is used. If no default policy is defined, then no statistics are collected unless a specifically defined accounting policy is applied.
By default, the subscriber host volume accounting data are based on the 14-byte Ethernet DLC header, 4-byte or 8-byte VLAN Tag (optional), 20-byte IP header, IP payload, and the 4-byte CRC (everything except the preamble and inter-frame gap). See Figure 20. This default can be altered by the packet-byte-offset configuration option.
The following displays an accounting policy configuration example:
The following displays an example of an event control configuration:
The following displays a log filter configuration example:
The associated log-id does not have to configured before a snmp-trap-group can be created, however, the snmp-trap-group must exist before the log-id can be configured to use it.
The following displays a basic SNMP trap group configuration example:
The following displays a SNMP trap group, log, and interface configuration examples:
For this example the replay parameter was set by a SNMP SET request for the trap-target address 10.10.10.3 which is bound to port-id 1/1/1.
In the following output, the Replay field changed from disabled to enabled.
Since no events are waiting to be replayed, the log displays as before.
A shutdown on the in-band port that the trap-target address is bound to causes the route to that particular trap target to be removed from the route table. When the SNMP module is notified of this event, it marks the trap-target as inaccessible and saves the sequence-id of the first SNMP notification that will be missed by the trap-target.
Example: config>log>snmp-trap-group# exit all #configure port 1/1/1 shutdown # # tools perform log test-event #
The Replay from field is updated with the sequence-id of the first event that will be replayed when the trap-target address is added back to the route table.
A display of the event log indicates which trap targets are not accessible and waiting for notification replay and the sequence ID of the first notification that will be replayed.
![]() | Note: If there are more missed events than the log size, the replay will actually start from the first available missed event. |
A no shutdown command executed on the in-band port to which the trap-target address is bound will cause the route to that trap target to be re-added to the route table. When the SNMP trap module is notified of this event, it resends the notifications that were missed while there was no route to the trap-target address.
Example: configure# port 1/1/1 no shutdown # # tools perform log test-event
After the notifications have been replayed the Replay from field indicates n/a because there are no more notifications waiting to be replayed and the Last replay field timestamp has been updated.
A display of the event log shows that it is no longer waiting to replay notifications to one or more of its trap target addresses. An event message has been written to the logger that indicates the replay to the trap-target address has happened and displays the notification sequence ID of the first and last replayed notifications.
Log events cannot be sent to a syslog target host until a valid syslog ID exists.
The following displays a syslog configuration example:
The following is an example custom record configuration.