Logging
Logging configuration controls the system message logging behavior on NX-OS devices, enabling centralized collection and severity-based filtering of operational and diagnostic messages. It supports global log level settings, per-facility severity overrides, remote syslog servers, local logfile management, console and terminal monitor output, source interface selection, timestamp formatting, and origin ID tagging for multi-device environments.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”configuration (nxos.devices)
Section titled “configuration (nxos.devices)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| logging | Class | [logging] | No |
logging (nxos.devices.configuration)
Section titled “logging (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| level | Choice | emergencies, alerts, critical, errors, warnings, notifications, information, debugging | No | |
| facilities | List | [facilities] | No | |
| logfile_name | String | No | ||
| logfile_severity | Choice | emergencies, alerts, critical, errors, warnings, notifications, information, debugging | No | |
| logfile_size | Integer | min: 4096, max: 4194304 | No | |
| logfile_persistent_threshold | Integer | min: 0, max: 99 | No | |
| source_interface_type | Choice | ethernet, loopback, mgmt, port-channel, vlan, vni | No | |
| source_interface_id | String | No | ||
| timestamp | Choice | microseconds, milliseconds, seconds | No | |
| monitor | Boolean | true, false | No | |
| monitor_severity | Choice | emergencies, alerts, critical, errors, warnings, notifications, information, debugging | No | |
| console | Boolean | true, false | No | |
| console_severity | Choice | emergencies, alerts, critical, errors, warnings, notifications, information, debugging | No | |
| origin_id_type | Choice | hostname, ip, string | No | |
| origin_id_value | String | No | ||
| servers | List | [servers] | No |
facilities (nxos.devices.configuration.logging)
Section titled “facilities (nxos.devices.configuration.logging)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | Choice | spanning-tree, session-mgr, radius, security, plugin, cdp, bootvar, aaa, interface-vlan, vshd, cfs, monitor, ntp, acllog, track, pltfm-config, lacp, otm | Yes | |
| level | Choice | emergencies, alerts, critical, errors, warnings, notifications, information, debugging | No |
servers (nxos.devices.configuration.logging)
Section titled “servers (nxos.devices.configuration.logging)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| host | String | Yes | ||
| severity | Choice | emergencies, alerts, critical, errors, warnings, notifications, information, debugging | No | |
| port | Integer | min: 1, max: 65535 | No | |
| vrf | String | No | ||
| facility | Choice | kern, user, mail, daemon, auth, syslog, lpr, news, uucp, cron, authpriv, ftp, local0, local1, local2, local3, local4, local5, local6, local7 | No | |
| transport | Choice | udp, tcp, tls | No | |
| trustpoint_client_identity | String | No |
Examples
Section titled “Examples”Example 1: Basic logging with global severity level
nxos: devices: - name: LEAF1 configuration: logging: level: warningsExample 2: Granular logging with per-facility severity overrides
nxos: devices: - name: LEAF1 configuration: logging: level: notifications facilities: - name: aaa level: information - name: spanning-tree level: warnings - name: lacp level: information - name: ntp level: warningsExample 3: Remote syslog servers with VRF and transport options
nxos: devices: - name: SPINE1 configuration: logging: level: notifications source_interface_type: loopback source_interface_id: "0" timestamp: milliseconds servers: - host: 10.0.0.1 severity: warnings port: 514 vrf: management facility: local7 transport: udp - host: 10.0.0.2 severity: information port: 6514 vrf: management transport: tls trustpoint_client_identity: syslog-certExample 4: Local logfile and console/monitor configuration
nxos: devices: - name: LEAF1 configuration: logging: level: notifications logfile_name: messages logfile_severity: notifications logfile_size: 4194304 logfile_persistent_threshold: 90 console_severity: errors monitor_severity: warningsExample 5: Disable console and monitor logging
nxos: devices: - name: LEAF1 configuration: logging: level: notifications console: false monitor: falseExample 6: Comprehensive logging for production fabric switch
nxos: devices: - name: BORDER-LEAF1 configuration: logging: level: notifications source_interface_type: loopback source_interface_id: "0" timestamp: milliseconds origin_id_type: hostname logfile_name: messages logfile_severity: notifications logfile_size: 4194304 console_severity: errors monitor_severity: warnings facilities: - name: aaa level: information - name: security level: information - name: spanning-tree level: notifications - name: lacp level: information servers: - host: 10.1.100.10 severity: warnings vrf: management facility: local7 - host: 10.1.100.11 severity: information vrf: management facility: local6 transport: tcpLogging configuration controls the system message logging behavior on NX-OS devices, enabling centralized collection and severity-based filtering of operational and diagnostic messages. It supports global log level settings ranging from emergencies to debugging, with per-facility granular severity overrides for specific subsystems such as AAA, spanning tree, LACP, NTP, RADIUS, and security. Logging is critical for network operations including troubleshooting, security event analysis, compliance auditing, and proactive monitoring of device health and protocol state changes.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”configuration (nxos.devices)
Section titled “configuration (nxos.devices)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| logging | Class | [logging] | No |
logging (nxos.devices.configuration)
Section titled “logging (nxos.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| level | Choice | emergencies, alerts, critical, errors, warnings, notifications, information, debugging | No | |
| facilities | List | [facilities] | No |
facilities (nxos.devices.configuration.logging)
Section titled “facilities (nxos.devices.configuration.logging)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | Choice | spanning-tree, session-mgr, radius, security, plugin, cdp, bootvar, aaa, interface-vlan, vshd, cfs, monitor, ntp, acllog, track, pltfm-config, lacp | Yes | |
| level | Choice | emergencies, alerts, critical, errors, warnings, notifications, information, debugging | No |
Examples
Section titled “Examples”Example 1: Basic logging with global severity level
nxos: devices: - name: LEAF1 configuration: logging: level: warningsExample 2: Granular logging with per-facility severity overrides
nxos: devices: - name: LEAF1 configuration: logging: level: notifications facilities: - name: aaa level: information - name: spanning-tree level: warnings - name: lacp level: information - name: ntp level: warningsExample 3: Comprehensive logging configuration for production fabric switch
nxos: devices: - name: BORDER-LEAF1 configuration: logging: level: notifications facilities: - name: aaa level: information - name: security level: information - name: radius level: warnings - name: spanning-tree level: notifications - name: lacp level: information - name: ntp level: warnings - name: interface-vlan level: information - name: monitor level: warnings