Notes - Syslog on IOS-XR

Syslog on IOS-XR is very similar to IOS-XE.

Logging to buffer

Logging buffer is already enabled by default with a size of 2097152 bytes. To change this:

logging buffered <bytes>

Logging to external syslog server

IOS-XR uses the syntax “logging <destination>” to log to a syslog server. Also, you define the severity level on a per-server basis.

logging 1.1.1.1 severity info [port <number>] [vrf <name>]

In IOS-XE, we use “logging trap <severity>” for the severity level for syslog destinations, but on IOS-XR this command configures the severity for SNMP traps instead.

You can also set the facility, which is used to identify the application/process that generated the message on the syslog server.

logging facility <facility>

You may also need to set the source-interface

logging source-interface <interface>

Logging options

On IOS-XR, we can appended the hostname prefix to syslog messages using:

logging hostnameprefix

Service timestamps are configured identically to IOS-XE, using service timestamps

Duplicate messages can be suppressed using:

logging suppress duplicates

Log to SNMP server

We can send logs as traps using

snmp-server traps syslog

Persistent logging

On IOS-XR, we use the “logging archive” command to configure logging to a persistent local filesystem.

logging archive device harddisk

Options such as the severity, frequency, max file size, etc. are configured under “logging archive”

Disabling console logging

On IOS-XE, we use “no logging console” but on IOS-XR we use:

logging console disable

Note that on IOS-XR no logging console simply configures the logging console settings back to default. The default setting is that logging console is enabled with severity info.

Last updated