The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
This chapter describes how to configure system message logging on the device.
This chapter includes the following topics:
•Information About System Message Logging
•System Message Logging Facilities
•Configuring System Message Logging
•Verifying System Message Logging Configuration
•System Message Logging Example Configuration
•Feature History for 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.
Table 12-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 "System Message Logging Facilities" section. For information about configuring the severity level by module and facility, see the "Configuring System Message Logging for Modules" section.
syslog servers run on remote systems that are configured to log system messages based on the syslog protocol. You can configure up to three 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.
Table 12-2 lists the facilities that you can use in system message logging configuration.
System messages are logged to the console and the logfile by default.
This section includes the following topics:
•Configuring System Message Logging to Terminal Sessions
•Restoring System Message Logging Defaults for Terminal Sessions
•Configuring System Message Logging for Modules
•Restoring System Message Logging Defaults for Modules
•Configuring System Message Logging for Facilities
•Restoring System Message Logging Defaults for Facilities
•Restoring System Message Logging Defaults for Servers
•Using a UNIX or Linux System to Configure Logging
Note Be aware that Cisco Nexus 1000V commands may differ from the Cisco IOS commands.
Use this procedure to log messages by severity level to console, telnet, and SSH sessions.
Before beginning this procedure, you must know or do the following.
•By default, logging is enabled for terminal sessions.
1. terminal monitor
2. config t
3. logging console [severity-level]
4. show logging console
5. logging monitor [severity-level]
6. show logging monitor
7. copy running-config startup-config
|
|
|
---|---|---|
Step 1 |
terminal monitor Example: n1000v# terminal monitor n1000v# |
Enables the device to log messages to the console. |
Step 2 |
config t Example: n1000v# config t n1000v(config)# |
Enters global configuration mode. |
Step 3 |
logging console [severity-level] Example: n1000v(config)# logging console 2 n1000v(config)# |
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 12-1. If the severity level is not specified, the default of 2 is used. |
Step 4 |
show logging console |
(Optional) Displays the console logging configuration. |
Step 5 |
logging monitor [severity-level] Example: n1000v(config)# logging monitor 3 n1000v(config)# |
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 12-1. If the severity level is not specified, the default of 2 is used. |
Step 6 |
show logging monitor |
(Optional) Displays the monitor logging configuration. |
Step 7 |
copy running-config startup-config Example: n1000v(config)# copy running-config startup-config |
(Optional) Copies the running configuration to the startup configuration. |
Example:
n1000v# terminal monitor
n1000v# config t
n1000v(config)# logging console 2
n1000v(config)# show logging console
Logging console: enabled (Severity: critical)
n1000v(config)# logging monitor 3
n1000v(config)# show logging monitor
Logging monitor: enabled (Severity: errors)
n1000v(config)#
n1000v(config)# copy running-config startup-config
Use the following commands in the CLI Global Configuration mode to restore default settings for system message logging for terminal sessions.
Use this procedure to configure the severity level and time-stamp units of messages logged by modules.
1. config t
2. logging module [severity-level]
3. show logging module
4. logging timestamp {microseconds | milliseconds | seconds}
5. show logging timestamp
6. copy running-config startup-config
|
|
|
---|---|---|
Step 1 |
config t Example: n1000v# config t n1000v(config)# |
Places you into CLI Global Configuration mode. |
Step 2 |
logging module [severity-level] Example: n1000v(config)# logging module 3 |
Enables module log messages that have the specified severity level or higher. Severity levels, which range from 0 to 7, are listed in Table 12-1. If the severity level is not specified, the default of 5 is used. |
Step 3 |
show logging module |
(Optional) Displays the module logging configuration. |
Step 4 |
logging timestamp {microseconds | milliseconds | seconds} Example: n1000v(config)# logging timestamp microseconds |
Sets the logging time-stamp units. The default unit is seconds. |
Step 5 |
show logging timestamp |
(Optional) Displays the logging time-stamp units configured. |
Step 6 |
copy running-config startup-config Example: n1000v(config)# copy running-config startup-config |
(Optional) Copies the running configuration to the startup configuration. |
The following example shows how to configure system message logging for modules.
Example:
n1000v# config t
n1000v(config)# logging module 3
n1000v(config)# show logging module
Logging linecard: enabled (Severity: errors)
n1000v(config)# logging timestamp microseconds
n1000v(config)# show logging timestamp
Logging timestamp: Microseconds
n1000v(config)# copy running-config
Use the following commands in the CLI Global Configuration mode to restore default settings for system message logging for modules.
Use this procedure to configure the severity level and time-stamp units of messages logged by facilities.
1. config t
2. logging level facility severity-level
3. show logging level [facility]
4. logging timestamp {microseconds | milliseconds | seconds}
5. show logging timestamp
6. copy running-config startup-config
|
|
|
---|---|---|
Step 1 |
config t Example: n1000v# config t n1000v(config)# |
Places you into CLI Global Configuration mode. |
Step 2 |
logging level facility severity-level Example: n1000v(config)# logging level aaa 3 n1000v(config)# |
Enables logging messages from the specified facility that have the specified severity level or higher. The facilities are listed in the "System Message Logging Facilities" section. Severity levels, which range from 0 to 7, are listed in Table 12-1. To apply the same severity level to all facilities, use the all facility. For defaults, see the show logging level command. |
Step 3 |
show logging level [facility] Example: n1000v(config)# show logging level aaa |
(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. |
Step 4 |
logging timestamp {microseconds | milliseconds | seconds} Example: n1000v(config)# logging timestamp microseconds |
Sets the logging time-stamp units. The default unit is seconds. |
Step 5 |
show logging timestamp |
(Optional) Displays the logging time-stamp units configured. |
Step 6 |
copy running-config startup-config Example: n1000v(config)# copy running-config startup-config |
(Optional) Copies the running configuration to the startup configuration. |
The following example shows how to configure system message logging for facilities.
Example:
n1000v# config t
n1000v(config)# logging level aaa 3
n1000v(config)# show logging level aaa
Facility Default Severity Current Session Severity
-------- ---------------- ------------------------
aaa 2 3
0(emergencies) 1(alerts) 2(critical)
3(errors) 4(warnings) 5(notifications)
6(information) 7(debugging)
logging timestamp microseconds
n1000v(config)# show logging timestamp
Logging timestamp: Microseconds
copy running-config startup-config
Use the following commands to restore system message logging defaults for facilities.
Use this procedure to configure syslog servers for system message logging.
1. config t
2. logging server host [severity-level [use_vrf vrf-name]]
3. show logging server
4. copy running-config startup-config
|
|
|
---|---|---|
Step 1 |
config t Example: n1000v# config t n1000v(config)# |
Enters global configuration mode. |
Step 2 |
logging server host [severity-level [use-vrf vrf-name]] Example:
n1000v(config)# logging server 10.10.2.2 7
|
Configures a syslog server at the specified host name or IPv4 or IPv6 address. You can limit logging of messages to a particular VRF by using the use_vrf keyword. Severity levels, which range from 0 to 7, are listed in Table 12-1. The default outgoing facility is local7. The example forwards all messages on facility |
Step 3 |
show logging server Example: n1000v(config)# show logging server Logging server: enabled {10.10.2.2} server severity: debugging server facility: local7 |
(Optional) Displays the syslog server configuration. |
Step 4 |
copy running-config startup-config Example: n1000v(config)# copy running-config startup-config |
(Optional) Copies the running configuration to the startup configuration. |
Use the following command to restore server system message logging default.
|
|
---|---|
no logging server host Example: n1000v(config)# no logging server host |
Removes the logging server for the specified host. |
Use this procedure on a UNIX or Linux system to configure message logging.
Before you begin this procedure, you must know or do the following:
•The following are the UNIX or Linux fields to configure for syslog:
.
Step 1 On the UNIX or Linux system, add the following line to the file, /var/log/myfile.log:
facility.level <five tab characters> action
Example:
debug.local7 /var/log/myfile.log
Step 2 Create the log file by entering these commands at the shell prompt:
$ touch /var/log/myfile.log
$ chmod 666 /var/log/myfile.log
Step 3 Make sure the system message logging daemon reads the new changes by checking myfile.log after entering this command:
$ kill -HUP ~cat /etc/syslog.pid~
Use this procedure to display messages in the log file.
1. show logging last number-lines
|
|
|
---|---|---|
Step 1 |
show logging last number-lines |
Displays the last number of lines in the logging file. You can specify from 1 to 9999 for the last number of lines. |
Example:
n1000v# show logging last 5
2008 Aug 31 09:37:04 CP-beta2 %KERN-3-SYSTEM_MSG: packet_recvms
g: truncated packet (size=1514 left=1500) - kernel
2008 Aug 31 09:37:04 CP-beta2 %KERN-3-SYSTEM_MSG: packet_recvms
g: truncated packet (size=1514 left=1500) - kernel
2008 Aug 31 09:37:05 CP-beta2 %KERN-3-SYSTEM_MSG: packet_recvms
g: truncated packet (size=1514 left=1500) - kernel
2008 Aug 31 09:37:05 CP-beta2 %KERN-3-SYSTEM_MSG: packet_recvms
g: truncated packet (size=1514 left=1500) - kernel
2008 Aug 31 09:37:05 CP-beta2 %KERN-3-SYSTEM_MSG: packet_recvms
g: truncated packet (size=1514 left=1500) - kernel
n1000v#
To display system message logging configuration information, perform one of the following tasks:
|
|
---|---|
show logging console |
Displays the console logging configuration. See Example 12-1 |
show logging info |
Displays the logging configuration. See Example 12-2 |
show logging last number-lines |
Displays the last number of lines of the log file. See Example 12-3 |
show logging level [facility] |
Displays the facility logging severity level configuration. See Example 12-4 |
show logging module |
Displays the module logging configuration. See Example 12-5 |
show logging monitor |
Displays the monitor logging configuration. See Example 12-6 |
show logging server |
Displays the syslog server configuration. See Example 12-7 |
show logging session |
Displays the logging session status. See Example 12-8 |
show logging status |
Displays the logging status. See Example 12-9 |
show logging timestamp |
Displays the logging time-stamp units configuration. See Example 12-10 |
Example 12-1 show logging console
n1000v# show logging console
Logging console: disabled
n1000v#
Example 12-2 show logging info
n1000v# show logging info
Logging console: enabled (Severity: critical)
Logging monitor: enabled (Severity: notifications)
Logging linecard: enabled (Severity: notifications)
Logging timestamp: Seconds
Logging server: disabled
Logging logfile: enabled
Name - g/external/messages: Severity - notifications Size - 4194304
Facility Default Severity Current Session Severity
-------- ---------------- ------------------------
aaa 2 2
auth 0 0
authpriv 3 3
bootvar 5 5
callhome 2 2
cdp 2 2
cert_enroll 2 2
cfs 3 3
confcheck 2 2
cron 3 3
daemon 3 3
diagclient 2 2
diagmgr 2 2
eth_port_channel 5 5
ethpm 5 5
evmc 5 5
evms 2 2
feature-mgr 2 2
ftp 3 3
ifmgr 5 5
igmp_1 3 3
ip 2 2
ipv6 2 2
kern 6 6
l2fm 2 2
licmgr 6 6
local0 3 3
local1 3 3
local2 3 3
local3 3 3
local4 3 3
local5 3 3
local6 3 3
local7 3 3
lpr 3 3
mail 3 3
mfdm 2 2
module 5 5
monitor 7 7
msp 2 2
mvsh 2 2
news 3 3
ntp 2 2
otm 3 3
pblr 2 2
pixm 2 2
pixmc 2 2
platform 5 5
portprofile 5 5
private-vlan 3 3
radius 2 2
res_mgr 2 2
rpm 2 2
sal 2 2
securityd 2 2
sksd 3 3
stp 3 3
syslog 3 3
sysmgr 3 3
ufdm 2 2
urib 3 3
user 3 3
uucp 3 3
vdc_mgr 6 6
vim 5 5
vlan_mgr 2 2
vms 5 5
vshd 5 5
xmlma 3 3
0(emergencies) 1(alerts) 2(critical)
3(errors) 4(warnings) 5(notifications)
6(information) 7(debugging)
n1000v$
Example 12-3 show logging last
n1000v# show logging last 5
2008 Jul 29 17:52:42 S22-DCOS %ETHPORT-5-IF_UP: Interface Ethernet2/5 is up in mode access
2008 Jul 29 17:52:43 S22-DCOS %ETHPORT-5-IF_UP: Interface Ethernet2/2 is up in mode trunk
2008 Jul 29 17:52:43 S22-DCOS %ETHPORT-5-IF_UP: Interface Ethernet2/4 is up in mode access
2008 Jul 29 17:53:04 S22-DCOS %SYSMGR-3-BASIC_TRACE: process_cfg_write: PID 1858 with message rcvd cfg_action from
sap 0x545 for vdc 1 at time 1217353984 .
2008 Jul 29 17:53:04 S22-DCOS clis[2558]: CLI-3-NVDB: Batched send failed for component: clic
n1000v#
Example 12-4 show logging level aaa
n1000v# show logging level aaa
Facility Default Severity Current Session Severity
-------- ---------------- ------------------------
aaa 2 2
0(emergencies) 1(alerts) 2(critical)
3(errors) 4(warnings) 5(notifications)
6(information) 7(debugging)
n1000v#
Example 12-5 show logging module
n1000v# show logging module
Logging linecard: enabled (Severity: notifications)
n1000v#
Example 12-6 show logging monitor
n1000v# show logging monitor
Logging monitor: enabled (Severity: errors)
n1000v#
Example 12-7 show logging server
n1000v# show logging server
Logging server: enabled
{10.10.2.2}
server severity: debugging
server facility: local7
n1000v#
Example 12-8 show logging session status
n1000v# show logging session status
Last Action Time Stamp : Fri Nov 18 11:28:55 1910
Last Action : Distribution Enable
Last Action Result : Success
Last Action Failure Reason : none
n1000v#
Example 12-9 show logging status
n1000v# show logging status
Fabric Distribute : Enabled
Session State : IDLE
n1000v#
Example 12-10 show logging timestamp
n1000v# show logging timestamp
Logging timestamp: Seconds
n1000v#
The following example shows how to configure system message logging:
config t
logging console 3
logging monitor 3
logging logfile my_log 6
logging module 3
logging level aaa 2
logging timestamp milliseconds
logging distribute
logging server 172.28.254.253
logging server 172.28.254.254 5 local3
logging commit
copy running-config startup-config
Table 12-3 lists the default settings for system message logging parameters.
|
|
---|---|
Console logging |
Enabled at severity level 2 |
Monitor logging |
Enabled at severity level 5 |
Log file logging |
Enabled to log messages at severity level 5 |
Module logging |
Enabled at severity level 5 |
Facility logging |
Enabled; for severity levels, see the "System Message Logging Facilities" section. |
Time-stamp units |
Seconds |
syslog server logging |
Disabled |
syslog server configuration distribution |
Disabled |
For additional information related to implementing system message logging, see the following sections:
|
|
---|---|
System management CLI commands |
Cisco Nexus 1000V Command Reference, Release 4.0(4)SV1(1) |
System messages |
Cisco NX-OS System Messages Reference |
|
|
---|---|
No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature. |
— |
This section provides the system message logging feature release history.
|
|
|
---|---|---|
System Message Logging |
4.0(4)SV1(1) |
This feature was introduced. |