# Notes - Syslog on IOS-XR

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

### Logging to buffer <a href="#id-739ca0f5-f525-4759-82c0-8a3a78269323" id="id-739ca0f5-f525-4759-82c0-8a3a78269323"></a>

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

```
logging buffered <bytes>
```

### Logging to external syslog server <a href="#id-35bf2029-149e-4b84-815c-3dc9cebab96d" id="id-35bf2029-149e-4b84-815c-3dc9cebab96d"></a>

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 <a href="#b0405999-fcc6-4b57-802a-8637c40b0326" id="b0405999-fcc6-4b57-802a-8637c40b0326"></a>

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 <a href="#a297df2a-5603-40ba-aa16-792884e8280e" id="a297df2a-5603-40ba-aa16-792884e8280e"></a>

We can send logs as traps using

```
snmp-server traps syslog
```

### Persistent logging <a href="#id-494105b2-5567-4a9c-bc06-df32e5d12f86" id="id-494105b2-5567-4a9c-bc06-df32e5d12f86"></a>

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 <a href="#a194050b-5f6e-4433-9fae-800f42cf9724" id="a194050b-5f6e-4433-9fae-800f42cf9724"></a>

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**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ccie-sp.gitbook.io/ccie-spv5.1-labs/labs/assurance/notes-syslog-on-ios-xr.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
