Understanding Syslog: How Devices Talk About What’s Happening

If you’ve ever wondered how network devices and servers keep track of what’s going on, syslog is a big part of the answer. It’s a standard way for devices to send messages about their status, errors, and other important events to a central place where you can review and analyze them. In this blog, we’ll break down what syslog is, why it matters, and how it helps IT teams keep everything running smoothly.
Now that we have a basic idea of why syslog is important, let’s dive into what syslog actually is.
Syslog is a protocol used by devices like routers, switches, servers, and even some applications to send log messages. These messages contain information about what’s happening on the device like errors, warnings, or just general status updates.
Think of syslog as a way for devices to “talk” and report their activities to a central place called a syslog server or collector. This helps system administrators keep an eye on multiple devices all at once without having to check each one individually.
It’s a simple but powerful tool that plays a key role in monitoring and troubleshooting networks and systems.
Cisco IOS syslog messages have a specific format that helps you quickly identify what the message is about. Each message consists of these parts:
Sequence Number: A unique number that helps keep track of messages in order.
Timestamp: The date and time when the event occurred.
Facility: The part of the system or process that generated the message, like the interface, routing, or system.
Severity: How serious the message is, ranging from emergencies to just informational.
Mnemonic: A short code or keyword that gives a quick hint about the type of event.
Description: A clear explanation of the event or issue.
For example, a Cisco IOS syslog might look like this:
*Mar 1 10:20:30.123: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to up
*Mar 1 10:20:30.123
is the timestamp%LINK
is the facility3
is the severity levelUPDOWN
is the mnemonicThe rest is the description
This format makes it easier to understand the message at a glance and helps with troubleshooting.
Syslog Severity Levels
Now that we know the basic parts of a syslog message, let’s talk about severity levels. Severity tells us how serious the message is, which helps you decide how urgently you need to respond. Cisco IOS uses numbers from 0 to 7 to represent these levels, where 0 is the most critical and 7 is just informational.
Here’s a quick table to show what each severity level means:
Severity Level | Name | What It Means |
0 | Emergency | System is unusable, critical failure |
1 | Alert | Immediate action needed |
2 | Critical | Serious problems |
3 | Error | Error conditions |
4 | Warning | Potential issues |
5 | Notice | Normal but significant events |
6 | Informational | General information messages |
7 | Debugging | Detailed debug information |
Understanding these levels helps you filter and prioritize syslog messages so you focus on what matters most.
Examples of Syslog Messages on Cisco IOS CLI
Here are some common syslog messages you might see when working with Cisco IOS devices. These examples show different severity levels and events:
%LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up
%SYS-5-CONFIG_I: Configured from console by admin on vty0 (192.168.1.100)
%SECURITY-4-LOGIN_FAILED: Login failed for user admin from 10.1.1.5
%SYS-6-LOGGINGHOST_STARTSTOP: Logging to host 192.168.1.200 started - CLI initiated
%LINK-3-UPDOWN
means the physical interface went up or down (severity level 3: error).%LINEPROTO-5-UPDOWN
means the protocol on the interface changed state (severity 5: notice).%SYS-5-CONFIG_I
shows configuration changes made (severity 5: notice).%SECURITY-4-LOGIN_FAILED
indicates a failed login attempt (severity 4: warning).%SYS-6-LOGGINGHOST_STARTSTOP
logs when syslog to a remote server starts or stops (severity 6: informational).
These messages help you track important changes, errors, and security events on your device in real time.
Syslog Logging Locations
Now that we’ve seen examples of syslog messages, let’s look at where these messages can be sent or stored. Cisco devices give you several options for logging, so you can choose what works best for your setup. Here are the main syslog logging locations:
Console Line:
Messages are shown directly on the device’s console screen. This is useful for real-time monitoring when you’re physically connected.VTY Line (Virtual Terminal):
Logs are sent to remote sessions, like when you’re connected via SSH or Telnet. This helps you see messages while managing the device remotely.Buffer:
The device keeps a local memory area (called a buffer) to store syslog messages. You can review these later without needing to be connected at the time the message was generated.External Syslog Server:
Messages are sent over the network to a separate syslog server. This is ideal for centralized logging, where you collect logs from multiple devices in one place for easier monitoring and analysis.
Each location serves a different purpose, and you can configure your Cisco device to send syslog messages to one or more of these destinations depending on your needs.
Configuring Syslog on Cisco IOS CLI
Now that you know where syslog messages can go, let’s see how to set up syslog on a Cisco IOS device using the command line. Configuring syslog lets you control which messages are sent, where they go, and how much detail you get.
Here are some common commands you’ll use:
Enable logging:
logging on
This turns on syslog messaging on the device.
Set the logging level:
logging console [severity-level]
This controls which messages appear on the console. Replace
[severity-level]
with a number from 0 to 7, depending on how much detail you want.Send logs to a remote syslog server:
logging host [IP address]
Replace
[IP address]
with the server’s IP to forward syslog messages there.Enable logging to buffer:
logging buffered [severity-level]
This stores messages locally in the device’s memory buffer.
View the buffered logs:
show logging
This command displays the messages stored in the buffer.
These are the basics to get you started. You can mix and match these settings based on what you want to monitor and where you want to see your logs.
Syslog Configuration Examples on Cisco IOS CLI
Here are some practical examples to help you configure syslog on your Cisco device:
Turn on logging:
Router(config)# logging on
Send all messages of severity level 4 (warnings) and higher to the console:
Router(config)# logging console 4
Store syslog messages locally in the buffer with severity level 5 (notice) and above:
Router(config)# logging buffered 5
Send syslog messages to a remote server with IP address 192.168.1.100:
Router(config)# logging host 192.168.1.100
Check the messages stored in the buffer:
Router# show logging
These examples cover common tasks you’ll use to manage syslog on Cisco devices. Adjust the severity levels depending on how much detail you want to capture.
Terminal Monitor Command
When you’re connected to a Cisco device remotely using SSH or Telnet, syslog messages don’t show up on your screen by default. To see these messages in real time during your session, you can use the terminal monitor
command.
Here’s how it works:
Enable real-time syslog messages on your terminal:
Router# terminal monitor
This command tells the device to send syslog messages directly to your terminal session, so you don’t miss important events while you’re connected remotely.
If you want to stop seeing these messages, just use:
Router# terminal no monitor
This is handy when you want to watch what’s happening on the device without physically being at the console.
Logging Monitor Command
Along with the terminal monitor
command, Cisco IOS also uses the logging monitor
command to control which syslog messages are sent to your remote terminal session.
By default, when you enable terminal monitor
, all syslog messages are sent to your screen. But with logging monitor
, you can set a severity level to filter the messages you receive. This way, you only see the important ones.
For example:
Router(config)# logging monitor 4
This command will send syslog messages with severity level 4 (warnings) and above to your remote terminal session.
To disable logging to your terminal, you can use:
Router(config)# no logging monitor
Using terminal monitor
and logging monitor
together helps you keep track of critical events without getting overwhelmed by less important messages.
Logging Synchronous Command
When you’re working on a Cisco device’s console or terminal, syslog messages can sometimes interrupt your typing, making it hard to see what you’re entering. The logging synchronous
command helps fix this by making sure the messages appear cleanly, without breaking your command line.
Here’s how you use it:
Router(config-line)# logging synchronous
You usually enter this command while configuring the console or VTY line, like this:
Router(config)# line console 0
Router(config-line)# logging synchronous
With this enabled, syslog messages will show up on your screen but won’t disrupt the commands you’re typing. It makes working on the device much smoother, especially when messages are frequent.
Service Timestamp and Service Sequence-Number Commands
To make syslog messages easier to read and track, Cisco IOS offers two useful commands: service timestamps
and service sequence-number
.
1. Service Timestamp
This command adds a timestamp to each syslog message, showing exactly when the event happened. You can include the date, time, and even milliseconds for more precision.
Example:
Router(config)# service timestamps log datetime msec
This adds the full date and time with milliseconds to every syslog message, making it easier to know the exact moment an event occurred.
2. Service Sequence-Number
This command adds a unique sequence number to each syslog message. It helps you keep messages in order, which is especially helpful when reviewing logs later.
Example:
Router(config)# service sequence-number
With these commands enabled, your syslog messages will be clearer and easier to manage.
Differences Between Syslog and SNMP
Syslog and SNMP are both important tools for network monitoring, but they work in different ways and serve different purposes. Here’s a simple comparison to help you understand how they differ:
Feature | Syslog | SNMP |
Purpose | Sends log messages about events and errors | Monitors and manages network devices by collecting data and sending alerts |
Data Type | Text messages describing events | Numeric data and status information |
Communication | Devices send messages to a syslog server | Manager polls devices or devices send traps (alerts) |
Real-Time? | Yes, messages are sent as events happen | Mostly polled at intervals; traps can be real-time alerts |
Setup Complexity | Simple to configure | More complex; involves management stations and agents |
Use Cases | Troubleshooting, logging events | Performance monitoring, device management |
Protocol | Uses UDP port 514 | Uses UDP ports 161 (polling) and 162 (traps) |
In short, syslog is mainly about recording what happened on a device, while SNMP is about asking devices for information and managing them. Both are useful, and often used together in network management.
Syslog Command Summary
Here’s a quick reference to the common syslog-related commands on Cisco IOS:
Command | Purpose |
logging on | Enable syslog messaging |
logging console [level] | Send syslog messages of specified severity to the console |
logging buffered [level] | Store syslog messages locally in buffer with specified severity |
logging host [IP address] | Send syslog messages to a remote syslog server |
show logging | Display syslog messages stored in the buffer |
terminal monitor | Show syslog messages in your current remote terminal session |
logging monitor [level] | Set severity level for messages sent to remote terminal session |
no logging monitor | Disable sending syslog messages to terminal session |
logging synchronous | Prevent syslog messages from interrupting command input on console or terminal lines |
service timestamps log datetime msec | Add detailed timestamps to syslog messages |
service sequence-number | Add sequence numbers to syslog messages for easier tracking |
This summary covers the essential commands to get you started with syslog on Cisco devices.
Wrap Up
Syslog is a simple but powerful way for network devices to report what’s happening. By understanding its message format, severity levels, and where logs can be stored or sent, you can keep a close eye on your network’s health and quickly spot issues.
Configuring syslog on Cisco IOS is straightforward, whether you want to see messages on your console, store them locally, or send them to a remote server. Tools like terminal monitor
and logging synchronous
help make working with syslog easier, especially during remote sessions or busy command lines.
Remember, syslog works best when you customize it to fit your needs choosing the right severity levels and logging locations makes your monitoring more efficient. Combined with other tools like SNMP, syslog gives you a clearer picture of your network’s status.
If you’re starting out, try setting up basic syslog logging and gradually explore more options as you become comfortable. Keeping track of these messages will save you time and headaches when troubleshooting.
Subscribe to my newsletter
Read articles from Pits directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
