This section provides information to configure logging using the command line interface.
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.
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, the target CF or USB drive is specified, and the rollover retention interval period for the log file is defined. 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 storage device before it is deleted.
Use the following CLI syntax to configure a log file:
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:) 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.
policy can be defined as default. If statistics collection is enabled on an accounting object, and no accounting policy is applied, then the respective default accounting policy is used. If no default policy is defined, then no statistics are collected unless a specifically-defined accounting policy is applied.
Use the following CLI syntax to configure an accounting policy:
The following displays a accounting policy configuration example:
Use the following CLI syntax to configure event control. Note that the throttle parameter used in the event-control command syntax enables throttling for a specific event type. The config>log>throttle-rate command configures the number of events and interval length to be applied to all event types that have throttling enabled by this event-control command.
The following displays an event control configuration:
This command configures the number of events and interval length to be applied to all event types that have throttling enabled by the event-control command.
Use the following CLI syntax to configure the throttle rate.
The following displays a throttle rate configuration example:
Use the following CLI syntax to configure a log filter:
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.
Use the following CLI syntax to configure an SNMP trap group:
The following displays a basic SNMP trap group configuration example:
Use the following CLI syntax to configure SNMP dying gasp:
Sample Configuration
The system does not try to resolve the ARP when it needs to send out the SNMP dying-gasp trap, since the amount of time available during power loss event is very less. Instead, the system assumes that ARP entry to the gateway used to reach the SNMP trap server is always available. It is recommended that user run a periodic ping query to the SNMP trap server in the background using the cron utility.
Sample configuration of a cron job which initiates a ping to the server mentioned in the pingscript file every one minute:
Log events cannot be sent to a syslog target host until a valid syslog ID exists.
Use the following CLI syntax to configure a syslog file:
The following displays a syslog configuration example:
This section discusses the logging management tasks.
Use the following CLI syntax to modify a log file:
The following displays the current log configuration:
The following displays an example to modify log file parameters:
The following displays the modified log file configuration:
The log ID must be shut down first before it can be deleted. In a previous example, file 1 is associated with log-id 2.
Use the following CLI syntax to delete a log file:
The following displays an example to delete a log file:
![]() | Note: When the file-id location parameter is modified, log files are not written to the new location until a rollover occurs or the log is manually cleared. A rollover can be forced by using the clear>log command. Subsequent log entries are then written to the new location. If a rollover does not occur or the log not cleared, the old location remains in effect. |
The location can be CF (cflash-id) or USB (usb-flash-id).
Use the following CLI syntax to modify a log file ID:
The following displays the current log configuration:
The following displays an example to modify log file parameters:
The following displays the file modifications:
![]() | Note: All references to the file ID must be deleted before the file ID can be removed. |
Use the following CLI syntax to delete a file ID:
The following displays an example to delete a file ID:
![]() | Note: All references to the syslog ID must be deleted before the syslog ID can be removed. |
Use the following CLI syntax to modify a syslog ID parameters:
The following displays an example of the syslog ID modifications:
The following displays the syslog configuration:
Use the following CLI syntax to delete a syslog file:
The following displays an example to delete a syslog ID:
Use the following CLI syntax to modify an SNMP trap group:
The following displays the current SNMP trap group configuration:
The following displays an example of the command usage to modify an SNMP trap group:
The following displays the SNMP trap group configuration:
Use the following CLI syntax to delete a trap target and SNMP trap group:
The following displays the SNMP trap group configuration:
The following displays an example to delete a trap target and an SNMP trap group.
Use the following CLI syntax to modify a log filter:
The following output displays the current log filter configuration:
The following displays an example of the log filter modifications:
The following displays the log filter configuration:
Use the following CLI syntax to delete a log filter:
The following output displays the current log filter configuration:
The following displays an example of the command usage to delete a log filter:
Use the following CLI syntax to modify event control parameters:
The following displays the current event control configuration:
The following displays an example of an event control modification:
The following displays the log filter configuration:
The no form of the event-control command returns modified values back to the default values.
Use the following CLI syntax to modify event control parameters:
The following displays an example of the command usage to return to the default values: