- New and Changed Information
- Preface
- Overview
- Configuring CFS
- Configuring NTP
- Configuring PTP
- Configuring CDP
- Configuring System Message Logging
- Configuring Smart Call Home
- Configuring Rollback
- Configuring Session Manager
- Configuring the Scheduler
- Configuring SNMP
- Configuring RMON
- Configuring Online Diagnostics
- Configuring the Embedded Event Manager
- Configuring Onboard Failure Logging
- Configuring SPAN
- Configuring ERSPAN
- Configuring LLDP
- Configuring NetFlow
- Supported RFCs
- EEM Events and Examples
- Configuration Limits for Cisco NX-OS System Management
- Information About System Message Logging
- Licensing Requirements for System Message Logging
- Guidelines and Limitations
- Default Settings
- Configuring System Message Logging
- Verifying the System Message Logging Configuration
- Configuration Example for System Message Logging
- Additional References
- Feature History for System Message Logging
Configuring System Message Logging
This chapter describes how to configure system message logging on Cisco NX-OS devices.
This chapter includes the following sections:
- Information About System Message Logging
- Licensing Requirements for System Message Logging
- Guidelines and Limitations
- Default Settings
- Configuring System Message Logging
- Verifying the System Message Logging Configuration
- Configuration Example for System Message Logging
- Additional References
- Feature History for System Message Logging
Information About System Message Logging
You can use system message logging to control the destination and to filter the severity level of messages that system processes generate. You can configure logging to terminal sessions, a log file, and syslog servers on remote systems.
System message logging is based on RFC 3164 . For more information about the system message format and the messages that the device generates, see the Cisco NX-OS System Messages Reference .
By default, the device outputs messages to terminal sessions. For information about configuring logging to terminal sessions, see the “Configuring System Message Logging to Terminal Sessions” section.
By default, the device logs system messages to a log file. For information about configuring logging to a file, see the “Logging System Messages to a File” section.
Table 8-1 describes the severity levels used in system messages. When you configure the severity level, the system outputs messages at that level and lower.
The device logs the most recent 100 messages of severity 0, 1, or 2 to the NVRAM log. You cannot configure logging to the NVRAM.
You can configure which system messages should be logged based on the facility that generated the message and its severity level. For information about facilities, see the Cisco Nexus 7000 Series NX-OS System Management Command Reference . For information about configuring the severity level by module and facility, see the “Configuring Module and Facility Messages Logged” section.
This section includes the following topics:
syslog Servers
The syslog servers run on remote systems that log system messages based on the syslog protocol. You can configure up to eight IPv4 or IPv6 syslog servers. For information about configuring syslog servers, see the “Configuring syslog Servers” section.

Note When the device first initializes, messages are sent to syslog servers only after the network is initialized.
Virtualization Support
A virtual device context (VDC) is a logical representation of a set of system resources. System message logging applies only to the VDC where commands are entered.
For information about configuring VDCs, see the Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 5.x .
Licensing Requirements for System Message Logging
Default Settings
Table 8-2 lists the default settings for system message logging parameters.
Configuring System Message Logging
This section includes the following topics:
- Configuring System Message Logging to Terminal Sessions
- Logging System Messages to a File
- Configuring Module and Facility Messages Logged
- Configuring syslog Servers
- Displaying and Clearing Log Files

Note Be aware that the Cisco NX-OS commands for this feature may differ from those commands used in Cisco IOS.
Configuring System Message Logging to Terminal Sessions
You can configure the device to log messages by their severity level to console, Telnet, and SSH sessions.
By default, logging is enabled for terminal sessions.

Tip The current critical (default) logging level is maintained if the console baud speed is 9600 baud (default). All attempts to change the console logging level generate an error message. To increase the logging level (above critical), you must change the console baud speed to 38400 baud.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
3. logging console [ severity-level ]
5. logging monitor [ severity-level ]
7. logging message interface type ethernet description
no logging message interface type ethernet description
8. copy running-config startup-config
Enter configuration commands, one per line. End with CNTL/Z. |
||
Configures the device to log messages to the console session based on a specified severity level or higher. Severity levels, which can range from 0 to 7, are listed in Table 8-1 . If the severity level is not specified, the default of 2 is used. |
||
Disables the device’s ability to log messages to the console. |
||
Enables the device to log messages to the monitor based on a specified severity level or higher. The configuration applies to Telnet and SSH sessions. Severity levels, which can range from 0 to 7, are listed in Table 8-1 . If the severity level is not specified, the default of 2 is used. |
||
logging message interface type ethernet description switch(config)# logging message interface type ethernet description |
Enables you to add the description for physical Ethernet interfaces and subinterfaces in the system message log. The description is the same description that was configured on the interface. |
|
no logging message interface type ethernet description switch(config)# no logging message interface type ethernet description |
Disables the printing of the interface description in the system message log for physical Ethernet interfaces. |
|
(Optional) Copies the running configuration to the startup configuration. |
Logging System Messages to a File
You can configure the device to log system messages to a file. By default, system messages are logged to the file log:messages.
For information about displaying and clearing log files, see the “Displaying and Clearing Log Files” section.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
2. logging logfile logfile-name severity-level [ size bytes ]
no logging logfile [ logfile-name severity-level [ size bytes ]]
3. logging event {link-status | trunk-status} {enable | default}
5. copy running-config startup-config
Enter configuration commands, one per line. End with CNTL/Z. |
||
Configures the name of the log file used to store system messages and the minimum severity level to log. You can optionally specify a maximum file size. The default severity level is 5 and the file size is 10485760. Severity levels are listed in Table 8-1 . The file size is from 4096 to 10485760 bytes. |
||
no logging logfile [ logfile-name severity-level [ size bytes ]] |
||
logging event {link-status | trunk-status} {enable | default} |
||
(Optional) Copies the running configuration to the startup configuration. |
Configuring Module and Facility Messages Logged
You can configure the severity level and time-stamp units of messages logged by modules and facilities.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
2. logging module [ severity-level ]
4. logging level facility severity-level
no logging level [ facility severity-level ]
5. show logging level [ facility ]
6. logging timestamp { microseconds | milliseconds | seconds }
no logging timestamp { microseconds | milliseconds | seconds }
8. copy running-config startup-config
Enter configuration commands, one per line. End with CNTL/Z. |
||
Enables module log messages that have the specified severity level or higher. Severity levels, which range from 0 to 7, are listed in Table 8-1 . If the severity level is not specified, the default of 5 is used. |
||
Enables logging messages from the specified facility that have the specified severity level or higher. The facilities are listed in the Cisco Nexus 7000 Series NX-OS System Management Command Reference . Severity levels, which range from 0 to 7, are listed in Table 8-1 . To apply the same severity level to all facilities, use the all facility. For defaults, see the show logging level command. |
||
Resets the logging severity level for the specified facility to its default level. If you do not specify a facility and severity level, the device resets all facilities to their default levels. |
||
(Optional) Displays the logging level configuration and the system default level by facility. If you do not specify a facility, the device displays levels for all facilities. |
||
Sets the logging time-stamp units. By default, the units are seconds. Note This command applies to logs that are kept in the switch. It does not apply to the external logging server. |
||
no logging timestamp { microseconds | milliseconds | seconds } |
Resets the logging time-stamp units to the default of seconds. Note This command applies to logs that are kept in the switch. It does not apply to the external logging server. |
|
(Optional) Displays the logging time-stamp units configured. |
||
(Optional) Copies the running configuration to the startup configuration. |
Configuring syslog Servers
You can configure up to eight syslog servers that reference remote systems where you want to log system messages.

Note We recommend that you configure the syslog server to use the management virtual routing and forwarding (VRF) instance. For more information on VRFs, see the Cisco Nexus 7000 Series NX-OS Unicast Routing Configuration Guide, Release 5.x.
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
2. logging server host [ severity-level [ use-vrf vrf-name ]]
3. logging source-interface loopback virtual-interface
5. copy running-config startup-config
Enter configuration commands, one per line. End with CNTL/Z. |
||
logging server host [ severity-level [ use-vrf vrf-name ]] |
Configures a syslog server at the specified hostname or IPv4 or IPv6 address. You can limit logging of messages to a particular VRF by using the use-vrf keyword. In Cisco NX-OS Release 4.2 or higher, the default VRF is default. Severity levels, which range from 0 to 7, are listed in Table 8-1 . The default outgoing facility is local7. Example 1 forwards all messages on facility local 7. Example 2 forwards messages with severity level 5 or lower for VRF red. |
|
Enables a source interface for the remote syslog server. The range for the virtual-interface argument is from 0 to 1023. |
||
(Optional) Copies the running configuration to the startup configuration. |
You can configure a syslog server on a UNIX or Linux system by adding the following line to the /etc/syslog.conf file:
Table 8-3 describes the syslog fields that you can configure.
To configure a syslog server on a UNIX or Linux system, follow these steps:
Step 1 Log debug messages with the local7 facility in the file /var/log/myfile.log by adding the following line to the /etc/syslog.conf file:
Step 2 Create the log file by entering these commands at the shell prompt:
Step 3 Make sure the system message logging daemon reads the new changes by checking myfile.log after entering this command:
BEFORE YOU BEGIN
Make sure that you are in the correct VDC. To change the VDC, use the switchto vdc command.
SUMMARY STEPS
1. show logging last number-lines
2. show logging logfile [ start-time yyyy mmm dd hh:mm:ss ] [ end-time yyyy mmm dd hh:mm:ss ]
3. show logging nvram [ last number-lines ]
Verifying the System Message Logging Configuration
To display system message logging configuration information, perform one of the following tasks:
For detailed information about the fields in the output from these commands, see the Cisco Nexus 7000 Series NX-OS System Management Command Reference .
Additional References
For additional information related to implementing system message logging, see the following sections:
Feature History for System Message Logging
Table 8-4 lists the release history for this feature.