- Preface
- New and Changed Information for this Release
- Overview
- Configuring User Accounts and RBAC
- Configuring Session Manager
- Configuring the Scheduler
- Configuring Online Diagnostics
- Configuring NTP
- Configuring System Message Logging
- Configuring Smart Call Home
- Configuring DNS
- Configuring SNMP
- Configuring RMON
- Configuring SPAN
- Configuring Warp SPAN
- Configuring Active Buffer Monitoring
- Configuring Warp Mode
- Index
- Information About System Message Logging
- Licensing Requirements for System Message Logging
- Guidelines and Limitations for System Message Logging
- Default Settings for System Message Logging
- Configuring System Message Logging
- Configuring System Message Logging to Terminal Sessions
- Configuring System Message Logging to a File
- Configuring Module and Facility Messages Logging
- Configuring Logging Timestamps
- Configuring the ACL Logging Cache
- Applying ACL Logging to an Interface
- Configuring the ACL Log Match Level
- Configuring Syslog Servers
- Configuring syslog Server Configuration Distribution
- Displaying and Clearing Log Files
- Verifying the System Message Logging Configuration
Configuring System Message Logging
This chapter contains the following sections:
- Information About System Message Logging
- Licensing Requirements for System Message Logging
- Guidelines and Limitations for System Message Logging
- Default Settings for System Message Logging
- Configuring System Message Logging
- Verifying the System Message Logging Configuration
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 Cisco Nexus Series switch outputs messages to terminal sessions.
By default, the switch logs system messages to a log file.
The following table describes the severity levels used in system messages. When you configure the severity level, the system outputs messages at that level and lower.
Level |
Description |
---|---|
0 – emergency |
System unusable |
1 – alert |
Immediate action needed |
2 – critical |
Critical condition |
3 – error |
Error condition |
4 – warning |
Warning condition |
5 – notification |
Normal but significant condition |
6 – informational |
Informational message only |
7 – debugging |
Appears during debugging only |
The switch 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.
Syslog Servers
Syslog servers run on remote systems that are configured to log system messages based on the syslog protocol. You can configure the Cisco Nexus Series switch to sends logs to up to eight syslog servers.
To support the same configuration of syslog servers on all switches in a fabric, you can use Cisco Fabric Services (CFS) to distribute the syslog server configuration.
Note |
When the switch first initializes, messages are sent to syslog servers only after the network is initialized. |
Licensing Requirements for System Message Logging
Product |
License Requirement |
---|---|
Cisco NX-OS |
System message logging requires no license. Any feature not included in a license package is bundled with the Cisco NX-OS system images and is provided at no extra charge to you. For a complete explanation of the Cisco NX-OS licensing scheme, see the Cisco NX-OS Licensing Guide. |
Guidelines and Limitations for System Message Logging
System messages are logged to the console and the logfile by default.
Default Settings for System Message Logging
The following table lists the default settings for system message logging parameters.
Parameters |
Default |
---|---|
Console logging |
Enabled at severity level 2 |
Monitor logging |
Enabled at severity level 2 |
Log file logging |
Enabled to log messages at severity level 5 |
Module logging |
Enabled at severity level 5 |
Facility logging |
Enabled |
Time-stamp units |
Seconds |
Syslog server logging |
Disabled |
Syslog server configuration distribution |
Disabled |
Configuring System Message Logging
Configuring System Message Logging to Terminal Sessions
You can configure the switch to log messages by their severity level to console, Telnet, and Secure Shell sessions.
By default, logging is enabled for terminal sessions.
The following example shows how to configure a logging level of 3 for the console:
switch# configure terminal
switch(config)# logging console 3
The following example shows how to display the console logging configuration:
switch# show logging console
Logging console: enabled (Severity: error)
The following example shows how to disable logging for the console:
switch# configure terminal
switch(config)# no logging console
The following example shows how to configure a logging level of 4 for the terminal session:
switch# terminal monitor
switch# configure terminal
switch(config)# logging monitor 4
The following example shows how to display the terminal session logging configuration:
switch# show logging monitor
Logging monitor: enabled (Severity: warning)
The following example shows how to disable logging for the terminal session:
switch# configure terminal
switch(config)# no logging monitor
Configuring System Message Logging to a File
You can configure the switch to log system messages to a file. By default, system messages are logged to the file log:messages.
The following example shows how to configure a switch to log system messages to a file:
switch# configure terminal switch(config)# logging logfile my_log 6 size 4194304
The following example shows how to display the logging configuration (some of the output has been removed for brevity):
switch# show logging info Logging console: enabled (Severity: debugging) Logging monitor: enabled (Severity: debugging) Logging timestamp: Seconds Logging server: disabled Logging logfile: enabled Name - my_log: Severity - informational Size - 4194304 Facility Default Severity Current Session Severity -------- ---------------- ------------------------ aaa 3 3 aclmgr 3 3 afm 3 3 altos 3 3 auth 0 0 authpriv 3 3 bootvar 5 5 callhome 2 2 capability 2 2 cdp 2 2 cert_enroll 2 2 ...
Configuring Module and Facility Messages Logging
You can configure the severity level and time-stamp units of messages logged by modules and facilities.
The following example shows how to configure the severity level of module and specific facility messages:
switch# configure terminal
switch(config)# logging module 3
switch(config)# logging level aaa 2
Configuring Logging Timestamps
You can configure the time-stamp units of messages logged by the Cisco Nexus Series switch.
The following example shows how to configure the time-stamp units of messages:
switch# configure terminal switch(config)# logging timestamp milliseconds switch(config)# exit switch# show logging timestamp Logging timestamp: Milliseconds
Configuring the ACL Logging Cache
The following example show how to set the maximum number of log entries to 5000, the interval to 120 seconds, and the threshold to 500000:
switch# configure terminal switch(config)# logging ip access-list cache entries 5000 switch(config)# logging ip access-list cache interval 120 switch(config)# logging ip access-list cache threshold 500000 switch(config)# copy running-config startup-config
Applying ACL Logging to an Interface
You can apply ACL logging only on the mgmt0 interface.
The following example shows how to apply the mgmt0 interface with the logging specified in acl1 for all ingress traffic:
switch# configure terminal switch(config)# interface mgmt0 switch(config-if)# ip access-group acl1 in switch(config-if)# copy running-config startup-config
Configuring the ACL Log Match Level
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 | switch# configure terminal | Enters global configuration mode. |
||
Step 2 | switch(config)# acllog match-log-level number |
|
||
Step 3 | switch(config)# copy running-config startup-config | (Optional) Saves the change persistently through reboots and restarts by copying 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.
Command or Action | Purpose | |||||
---|---|---|---|---|---|---|
Step 1 | configure terminal Example: switch# configure terminal switch(config)# |
Enters global configuration mode. |
||||
Step 2 | logging server host [severity-level [use-vrf vrf-name [facility facility]]] Example: switch(config)# logging server 172.28.254.254 5 use-vrf default facility local3 |
|
||||
Step 3 | no logging server host Example: switch(config)# no logging server 172.28.254.254 5 |
(Optional) Removes the logging server for the specified host. |
||||
Step 4 | show logging server Example: switch# show logging server |
(Optional) Displays the syslog server configuration. |
||||
Step 5 | copy running-config startup-config Example: switch(config)# copy running-config startup-config |
(Optional) Saves the change persistently through reboots and restarts by copying the running configuration to the startup configuration. |
The following examples show how to configure a syslog server:
switch# configure terminal switch(config)# logging server 172.28.254.254 5 use-vrf default facility local3 switch# configure terminal switch(config)# logging server 172.28.254.254 5 use-vrf management facility local3
Configuring syslog on a UNIX or Linux System
You can configure a syslog server on a UNIX or Linux system by adding the following line to the /etc/syslog.conf file:
facility.level <five tab characters> action
The following table describes the syslog fields that you can configure.
Field |
Description |
||
---|---|---|---|
Facility |
Creator of the message, which can be auth, authpriv, cron, daemon, kern, lpr, mail, mark, news, syslog, user, local0 through local7, or an asterisk (*) for all. These facility designators allow you to control the destination of messages based on their origin.
|
||
Level |
Minimum severity level at which messages are logged, which can be debug, info, notice, warning, err, crit, alert, emerg, or an asterisk (*) for all. You can use none to disable a facility. |
||
Action |
Destination for messages, which can be a filename, a hostname preceded by the at sign (@), or a comma-separated list of users or an asterisk (*) for all logged-in users. |
Configuring syslog Server Configuration Distribution
You can distribute the syslog server configuration to other switches in the network by using the Cisco Fabric Services (CFS) infrastructure.
After you enable syslog server configuration distribution, you can modify the syslog server configuration and view the pending changes before committing the configuration for distribution. As long as distribution is enabled, the switch maintains pending changes to the syslog server configuration.
Note |
If the switch is restarted, the syslog server configuration changes that are kept in volatile memory might get lost. |
You must have configured one or more syslog servers.
Displaying and Clearing Log Files
You can display or clear messages in the log file and the NVRAM.
The following example shows how to display messages in a log file:
switch# show logging last 40
switch# show logging logfile start-time 2007 nov 1 15:10:0
switch# show logging nvram last 10
The following example shows how to clear messages in a log file:
switch# clear logging logfile
switch# clear logging nvram
Verifying the System Message Logging Configuration
To display system message logging configuration information, perform one of the following tasks:
Command |
Purpose |
---|---|
show logging console | Displays the console logging configuration. |
show logging info | Displays the logging configuration. |
show logging internal info | Displays the syslog distribution information. |
show logging ip access-list cache | Displays the IP access list cache. |
show logging ip access-list cache detail | Displays detailed information about the IP access list cache. |
show logging ip access-list status | Displays the status of the IP access list cache. |
show logging last number-lines | Displays the last number of lines of the log file. |
show logging level [facility] | Displays the facility logging severity level configuration. |
show logging logfile [start-time yyyy mmm dd hh:mm:ss] [end-time yyyy mmm dd hh:mm:ss] | Displays the messages in the log file. |
show logging module | Displays the module logging configuration. |
show logging monitor | Displays the monitor logging configuration. |
show logging nvram [last number-lines] | Displays the messages in the NVRAM log. |
show logging pending | Displays the syslog server pending distribution configuration. |
show logging pending-diff | Displays the syslog server pending distribution configuration differences. |
show logging server | Displays the syslog server configuration. |
show logging session | Displays the logging session status. |
show logging status | Displays the logging status. |
show logging timestamp | Displays the logging time-stamp units configuration. |
show running-config acllog | Displays the running configuration for the ACL log file. |