- Preface
- Product Overview
- Command-Line Interfaces
- Configuring the Switch for the First Time
- Administering the Switch
- Configuring Virtual Switching Systems
- Programmability
- Configuring the Cisco IOS In-Service Software Upgrade Process
- Configuring the Cisco IOS XE In Service Software Upgrade Process
- Configuring Interfaces
- Checking Port Status and Connectivity
- Configuring Supervisor Engine Redundancy Using RPR and SSO on Supervisor Engine 6-E and Supervisor Engine 6L-E
- Configuring Supervisor Engine Redundancy Using RPR and SSO on Supervisor Engine 7-E, Supervisor Engine 7L-E, and Supervisor Engine 8-E
- Configuring Cisco NSF with SSO Supervisor Engine Redundancy
- Environmental Monitoring and Power Management
- Configuring Power over Ethernet
- Configuring Cisco Network Assistant
- Configuring VLANs, VTP, and VMPS
- Configuring IP Unnumbered Interface
- Configuring Layer 2 Ethernet Interfaces
- Configuring EVC-Lite
- Configuring SmartPort Macros
- Configuring Cisco IOS Auto Smartport Macros
- Configuring STP and MST
- Configuring Flex Links and MAC Address-Table Move Update
- Configuring Resilient Ethernet Protocol
- Configuring Optional STP Features
- Configuring EtherChannel and Link State Tracking
- Configuring IGMP Snooping and Filtering, and MVR
- Configuring IPv6 Multicast Listener Discovery Snooping
- Configuring 802.1Q Tunneling, VLAN Mapping, and Layer 2 Protocol Tunneling
- Configuring Cisco Discovery Protocol
- Configuring LLDP, LLDP-MED, and Location Service
- Configuring UDLD
- Configuring Unidirectional Ethernet
- Configuring Layer 3 Interfaces
- Configuring Cisco Express Forwarding
- Configuring Unicast Reverse Path Forwarding
- Configuring IP Multicast
- Configuring ANCP Client
- Configuring Bidirectional Forwarding Detection
- Configuring Campus Fabric
- Configuring Policy-Based Routing
- Configuring VRF-lite
- Configuring Quality of Service
- Configuring AVC with DNS-AS
- Configuring Voice Interfaces
- Configuring Private VLANs
- Configuring MACsec Encryption
- Configuring 802.1X Port-Based Authentication
- X.509v3 Certificates for SSH Authentication
- Configuring the PPPoE Intermediate Agent
- Configuring Web-Based Authentication
- Configuring Wired Guest Access
- Configuring Auto Identity
- Configuring Port Security
- Configuring Auto Security
- Configuring Control Plane Policing and Layer 2 Control Packet QoS
- Configuring Dynamic ARP Inspection
- Configuring the Cisco IOS DHCP Server
- Configuring DHCP Snooping, IP Source Guard, and IPSG for Static Hosts
- DHCPv6 Options Support
- Configuring Network Security with ACLs
- Support for IPv6
- Port Unicast and Multicast Flood Blocking
- Configuring Storm Control
- Configuring SPAN and RSPAN
- Configuring ERSPAN
- Configuring Wireshark
- Configuring Enhanced Object Tracking
- Configuring System Message Logging
- Onboard Failure Logging (OBFL)
- Configuring SNMP
- Configuring NetFlow-lite
- Configuring Flexible NetFlow
- Configuring Ethernet OAM and CFM
- Configuring Y.1731 (AIS and RDI)
- Configuring Call Home
- Configuring Cisco IOS IP SLA Operations
- Configuring RMON
- Performing Diagnostics
- Configuring WCCP Version 2 Services
- Configuring MIB Support
- Configuring Easy Virtual Networks
- ROM Monitor
- Acronyms and Abbreviations
- Index
- About System Message Logging
- Configuring System Message Logging
- System Log Message Format
- Default System Message Logging Configuration
- Disabling Message Logging
- Setting the Message Display Destination Device
- Synchronizing Log Messages
- Enabling and Disabling Timestamps on Log Messages
- Enabling and Disabling Sequence Numbers in Log Messages (Optional)
- Defining the Message Severity Level (Optional)
- Limiting Syslog Messages Sent to the History Table and to SNMP (Optional)
- Configuring UNIX Syslog Servers
Configuring System Message Logging
This chapter describes how to configure system message logging on the Catalyst 4500 series switch.
This chapter consists of these sections:
- About System Message Logging
- Configuring System Message Logging
- Displaying the Logging Configuration
Note For complete syntax and usage information for the switch commands used in this chapter, see the
Cisco IOS Command Reference Guides for the Catalyst 4500 Series Switch.
If a command is not in the Cisco Catalyst 4500 Series Switch Command Reference , you can locate it in the Cisco IOS Master Command List, All Releases.
About System Message Logging
By default, a switch sends the output from system messages and debug privileged EXEC commands to a logging process. The logging process controls the distribution of logging messages to various destinations, such as the logging buffer, terminal lines, or a UNIX syslog server, depending on your configuration. The process also sends messages to the console.
Note The syslog format is compatible with 4.3 BSD UNIX.
When the logging process is disabled, messages are sent only to the console. The messages are sent as they are generated, so message and debug output are interspersed with prompts or output from other commands. Messages are displayed on the console after the process that generated them has finished.
You can set the severity level of the messages to control the type of messages displayed on the consoles and each of the destinations. You can time-stamp log messages or set the syslog source address to enhance real-time debugging and management. For information on possible messages, see the system message guide for this release.
You can access logged system messages by using the switch command-line interface (CLI) or by saving them to a properly configured syslog server. The switch software saves syslog messages in an internal buffer on the switch. If the switch fails, the log is lost unless you had saved it to flash memory.
You can remotely monitor system messages by viewing the logs on a syslog server or by accessing the switch through Telnet or using the console port.
Configuring System Message Logging
These sections describe how to configure system message logging:
- System Log Message Format
- Default System Message Logging Configuration
- Disabling Message Logging
- Setting the Message Display Destination Device
- Synchronizing Log Messages
- Enabling and Disabling Timestamps on Log Messages
- Enabling and Disabling Sequence Numbers in Log Messages (Optional)
- Defining the Message Severity Level (Optional)
- Limiting Syslog Messages Sent to the History Table and to SNMP (Optional)
- Configuring UNIX Syslog Servers
System Log Message Format
System log messages can contain up to 80 characters and a percent sign (%), which follows the optional sequence number or time-stamp information, if configured. Messages are displayed in this format:
seq no:timestamp: %facility-severity-MNEMONIC:description
The part of the message preceding the percent sign depends on the setting of the
service sequence-numbers, service timestamps log datetime,
service timestamps log datetime [ localtime ] [ msec ] [ show-timezone ] command or the
service timestamps log uptime global configuration command.
Table 70-1 describes the elements of syslog messages.
|
|
---|---|
Stamps log messages with a sequence number only if the service sequence-numbers global configuration command is configured. For more information, see the “Enabling and Disabling Sequence Numbers in Log Messages (Optional)” section. |
|
Date and time of the message or event. This information appears only if the service timestamps log [ datetime | log ] global configuration command is configured. For more information, see the “Enabling and Disabling Timestamps on Log Messages” section. |
|
The facility to which the message refers (for example, SNMP, SYS, and so forth). For a list of supported facilities, see Table 70-4. |
|
Single-digit code from 0 to 7 that is the severity of the message. For a description of the severity levels, see Table 70-3. |
|
Text string containing detailed information about the event being reported. |
This example shows a partial switch system message:
Default System Message Logging Configuration
Table 70-2 shows the default system message logging configuration.
|
|
---|---|
Debugging (and numerically lower levels; see Table 70-3). |
|
Local7 (see Table 70-4). |
|
Informational (and numerically lower levels; see Table 70-3). |
Disabling Message Logging
Message logging is enabled by default. It must be enabled to send messages to any destination other than the console. When enabled, log messages are sent to a logging process, which logs messages to designated locations asynchronously to the processes that generated the messages.
To disable message logging, perform this task:
|
|
|
---|---|---|
|
||
|
||
|
||
|
||
|
Disabling the logging process can slow down the switch because a process must wait until the messages are written to the console before continuing. When the logging process is disabled, messages are displayed on the console as soon as they are produced, often appearing in the middle of command output.
The logging synchronous global configuration command also affects the display of messages to the console. When this command is enabled, messages appear only after you press Return. For more information, see the “Synchronizing Log Messages” section.
To reenable message logging after it has been disabled, use the logging on global configuration command.
Setting the Message Display Destination Device
If message logging is enabled, you can send messages to specific locations in addition to the console.
To specify the locations that receive messages, perform this task, beginning in privileged EXEC mode:
|
|
|
---|---|---|
|
||
|
Logs messages to an internal buffer on the switch. The default buffer size is 4096. The range is 4096 to 2147483647 bytes. If the switch, the log file is lost unless you previously saved it to flash memory. See Step 4. Note Do not make the buffer size too large because the switch could run out of memory for other tasks. Use the show memory privileged EXEC command to view the free processor memory on the switch. However, this value is the maximum available, and the buffer size should not be set to this amount. |
|
|
Logs messages to a UNIX syslog server host. For host, specify the name or IP address of the host to be used as the syslog server. To build a list of syslog servers that receive logging messages, enter this command more than once. For complete syslog server configuration steps, see the “Configuring UNIX Syslog Servers” section. |
|
|
||
|
Logs messages to a nonconsole terminal during the current session. Terminal parameter-setting commands are set locally and do not remain in effect after the session has ended. You must perform this step for each session to see the debugging messages. |
|
|
||
|
The logging buffered global configuration command copies logging messages to an internal buffer. The buffer is circular, so newer messages overwrite older messages after the buffer is full. To display the messages that are logged in the buffer, use the show logging privileged EXEC command. The first message displayed is the oldest message in the buffer. To clear the contents of the buffer, use the
clear logging privileged EXEC command.
To disable logging to the console, use the no logging console global configuration command. To disable logging to a file, use the no logging file [ severity-level-number | type ] global configuration command.
Synchronizing Log Messages
You can synchronize unsolicited messages and debug privileged EXEC command output with solicited device output and prompts for a specific console port line or virtual terminal line. You can identify the types of messages to be output asynchronously based on the level of severity. You can also configure the maximum number of buffers for storing asynchronous messages for the terminal after which messages are dropped.
When synchronous logging of unsolicited messages and debug command output is enabled, unsolicited device output appears on the console or printed after solicited device output appears or printed. Unsolicited messages and debug command output appears on the console after the prompt for user input is returned. Unsolicited messages and debug command output are not interspersed with solicited device output and prompts. After the unsolicited messages are displayed, the console again displays the user prompt.
To configure synchronous logging, perform this task:
To disable synchronization of unsolicited messages and debug output, use the
no logging synchronous [ level severity-level | all ] [ limit number-of-buffers ] line configuration command.
Enabling and Disabling Timestamps on Log Messages
Note By default, log messages are not time-stamped.
To enable time-stamping of log messages, perform this task:
To disable time-stamps for both debug and log messages, use the no service timestamps global configuration command.
This example shows part of a logging display with the service timestamps log datetime global configuration command enabled:
This example shows part of a logging display with the service timestamps log uptime global configuration command enabled:
Enabling and Disabling Sequence Numbers in Log Messages (Optional)
Because more than one log message can have the same timestamp, you can display messages with sequence numbers so that you can unambiguously refer to a single message. By default, sequence numbers in log messages are not displayed.
To enable sequence numbers in log messages, perform this task, which is optional.
|
|
|
---|---|---|
|
||
|
||
|
||
|
||
|
To disable sequence numbers, use the no service sequence-numbers global configuration command.
This example shows part of a logging display with sequence numbers enabled:
Defining the Message Severity Level (Optional)
You can limit messages displayed to the selected device by specifying the severity level of the message, which are described in Table 70-3 .
To define the message severity level, perform this task:
|
|
|
---|---|---|
|
||
|
Limits messages logged to the console. By default, the console receives debugging messages and numerically lower levels (see Table 70-3). |
|
|
Limits messages logged to the terminal lines. By default, the terminal receives debugging messages and numerically lower levels (see Table 70-3). |
|
|
Limits messages logged to the syslog servers. By default, syslog servers receive informational messages and numerically lower levels (see Table 70-3). For complete syslog server configuration steps, see the “Configuring UNIX Syslog Servers” section. |
|
|
||
|
||
|
Note Specifying a level causes messages at that level and numerically lower levels to be displayed at the destination.
To disable logging to the console, use the no logging console global configuration command. To disable logging to a terminal other than the console, use the no logging monitor global configuration command. To disable logging to syslog servers, use the no logging trap global configuration command.
Table 70-3 describes the level keywords. It also lists the corresponding UNIX syslog definitions from the most severe level to the least severe level.
|
|
|
|
---|---|---|---|
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
The software generates four other categories of messages:
- Error messages about software or hardware malfunctions, displayed at levels warnings through emergencies. These types of messages mean that the functionality of the switch is affected. For information on how to recover from these malfunctions, see the system message guide for this release.
- Output from the debug commands, displayed at the debugging level. Debug commands are typically used only by the Technical Assistance Center.
- Interface up or down transitions and system restart messages, displayed at the notifications level. This message is only for information; switch functionality is not affected.
- Reload requests and low-process stack messages, displayed at the informational level. This message is only for information; switch functionality is not affected.
Limiting Syslog Messages Sent to the History Table and to SNMP (Optional)
If you enabled syslog message traps to be sent to an SNMP network management station by using the snmp-server enable trap global configuration command, you can change the level of messages sent and stored in the switch history table. You also can change the number of messages that are stored in the history table.
Messages are stored in the history table because SNMP traps are not guaranteed to reach their destination. By default, one message of the level warning and numerically lower levels (see Table 70-3) are stored in the history table even if syslog traps are not enabled.
To change the level and history table size defaults, perform this task:
|
|
|
---|---|---|
|
||
|
Changes the default level of syslog messages stored in the history file and sent to the SNMP server. See Table 70-3 for a list of level keywords. By default, warnings, errors, critical, alerts, and emergencies messages are sent. |
|
|
Specifies the number of syslog messages that can be stored in the history table. The default is to store one message. The range is 0 to 500 messages. |
|
|
||
|
||
|
1.Table 70-3 lists the level keywords and severity level. For SNMP usage, the severity level values increase by 1. For example, emergencies equal 1, not 0, and critical equals 3, not 2. |
When the history table is full (it contains the maximum number of message entries specified with the logging history size global configuration command), the oldest message entry is deleted from the table to allow the new message entry to be stored.
To return the logging of syslog messages to the default level, use the no logging history global configuration command. To return the number of messages in the history table to the default value, use the no logging history size global configuration command.
Configuring UNIX Syslog Servers
The next sections describe how to configure the UNIX server syslog daemon and how to define the UNIX system logging facility.
Logging Messages to a UNIX Syslog Daemon
Before you can send system log messages to a UNIX syslog server, you must configure the syslog daemon on a UNIX server. This procedure is optional.
Note Some recent versions of UNIX syslog daemons no longer accept by default syslog packets from the network. If applies to your system, use the UNIX man syslogd command to decide what options must be added to or removed from the syslog command line to enable logging of remote syslog messages.
Log in as root, and perform these steps:
Step 1 Add a line such as the following to the file /etc/syslog.conf:
The local7 keyword specifies the logging facility to be used; see Table 70-4 for information on the facilities. The debug keyword specifies the syslog level; see Table 70-3 for information on the severity levels. The syslog daemon sends messages at this level or at a more severe level to the file specified in the next field. The file must already exist, and the syslog daemon must have permission to write to it.
Step 2 Create the log file by entering these commands at the UNIX shell prompt:
Step 3 Ensure that the syslog daemon reads the new changes:
For more information, see the man syslog.conf and man syslogd commands on your UNIX system.
Configuring the UNIX System Logging Facility
When sending system log messages to an external device, you can cause the switch to identify its messages as originating from any of the UNIX syslog facilities.
To configure UNIX system facility message logging, perform this task (which is optional):
|
|
|
---|---|---|
|
||
|
Logs messages to a UNIX syslog server host by entering its IP address. To build a list of syslog servers that receive logging messages, enter this command more than once. |
|
|
Limits messages logged to the syslog servers. Be default, syslog servers receive informational messages and lower. See Table 70-3 for level keywords. |
|
|
Configures the syslog facility. See Table 70-4 for facility-type keywords. |
|
|
||
|
||
|
To remove a syslog server, use the no logging host global configuration command, and specify the syslog server IP address. To disable logging to syslog servers, enter the no logging trap global configuration command.
Table 70-4 lists the UNIX system facilities supported by the software. For more information about these facilities, consult the operator’s manual for your UNIX operating system.
|
|
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Displaying the Logging Configuration
To display the logging configuration and the contents of the log buffer, use the show logging privileged EXEC command. For information about the fields in this display, see the Cisco IOS Configuration Fundamentals Command Reference, Release 12.3 .