show logging – Viewing & Analyzing Syslog Messages
What is Syslog?
Definition: Syslog is a widely adopted protocol used by network devices (routers, switches, firewalls, servers, etc.) to send, store, and relay log messages about events, operational status, and errors. It is a cornerstone for monitoring, auditing, and troubleshooting IT infrastructures.
- Supports both local (device buffer) and remote (central syslog server) logging.
- Enables event tracking, alerting, and compliance reporting.
Understanding show logging
Command
- Usage:
show logging
- Displays syslog messages stored in the device's internal logging buffer.
- Shows the configuration of logging destinations, buffer size, and recent log events.
Sample Output and Key Fields
*Jul 10 14:03:12.123: %LINK-3-UPDOWN: Interface GigabitEthernet0/1, changed state to up
Field | Explanation |
---|---|
Timestamp | Date and time the event occurred |
Facility/Source | Subsystem generating the log (e.g., %LINK) |
Severity Level | Numeric/word: 0 (emergency) to 7 (debug) |
Message Content | Describes the event or condition |
Syslog Message Components
- Timestamp: When the event happened (with or without milliseconds).
- Severity Level: Indicates urgency/importance (0 is most severe).
- Facility/Source: Which subsystem (e.g., LINK, LINEPROTO, CONFIG).
- Message Content: The actual description of the event.
Syslog Severity Levels
Level | Keyword | Meaning |
---|---|---|
0 | Emergency | System unusable |
1 | Alert | Immediate action required |
2 | Critical | Critical conditions |
3 | Error | Error conditions |
4 | Warning | Warning conditions |
5 | Notice | Normal but significant events |
6 | Informational | Informational messages |
7 | Debug | Debugging messages |
Tip: Lower numbers are more severe. Filter for higher severity when troubleshooting outages.
Syslog Configuration Basics
-
Logging Destinations:
- Buffer – Stores logs in device RAM (viewed with
show logging
). - Console – Shown to users on the console terminal.
- Monitor – Shown to users on vty/SSH sessions.
- Syslog Server – Sent externally for central archiving and analysis.
- Buffer – Stores logs in device RAM (viewed with
-
Setting Levels and Filters:
Specify which severity levels go to each destination.logging buffered 5 logging host 192.168.1.10 logging trap warnings
Interpreting Syslog Messages
Sample Message | What It Means |
---|---|
%LINK-3-UPDOWN: Interface changed state (Error) | Interface went up or down—watch for outages or hardware issues. |
%LINEPROTO-5-UPDOWN: Line protocol state change (Informational) | Usually accompanies interface status change—layer 2 or 3 issue. |
%SYS-5-CONFIG_I: Configuration change made (Notice) | Someone changed the running configuration—track who and what was changed. |
Syslog Buffer Management
-
Buffer Size: Determines how many log messages are stored.
logging buffered 64000
-
Clearing Buffer: Removes old logs to free space.
clear logging
Syslog Server Integration
- Forward syslog messages to a central server for archival, security, and compliance.
logging host 192.168.1.100 logging trap informational logging on
logging source-interface Vlan1Benefits:
- Centralized logs for longer retention and easier event correlation across devices.
- Supports compliance reporting and security monitoring.
Security Considerations
- Protect log integrity: Use secure syslog (TLS) and limit log access.
- Be aware that logs may include sensitive data (e.g., passwords, configs).
- Use encrypted channels for log forwarding and restrict access to syslog files.
Advanced Features & Best Practices
- Ensure accurate timestamps using NTP:
ntp server 192.168.1.1 service timestamps log datetime msec
- Use
logging synchronous
to control log display during configuration sessions. - Increase buffer size for more historical logs, but export to syslog server for long-term storage.
Example Use Case: Troubleshooting with show logging
Scenario: John is investigating a network outage. He runsshow logging
and finds:
*Jul 19 09:05:01.123: %LINK-3-UPDOWN: Interface GigabitEthernet0/2, changed state to down
He quickly identifies the cause (interface down) and can begin remediation.
Sample Syslog Troubleshooting Question
Scenario: John receives complaints of intermittent internet loss. On the core switch, he runs:show logging *Jul 20 10:12:05.789: %LINK-3-UPDOWN: Interface Gi1/0/24, changed state to down *Jul 20 10:12:08.799: %LINEPROTO-5-UPDOWN: Line protocol on Gi1/0/24, changed state to down *Jul 20 10:12:18.111: %LINK-3-UPDOWN: Interface Gi1/0/24, changed state to up *Jul 20 10:12:21.345: %LINEPROTO-5-UPDOWN: Line protocol on Gi1/0/24, changed state to up
- Diagnosis: The port is "flapping" (rapidly going up and down)—likely cable, port, or connected device issue.
- Troubleshooting:
- Physically check and reseat/replace the cable.
- Inspect the connected device for power/hardware faults.
- Run
show interfaces Gi1/0/24
for errors or CRC count. - If needed, move to a different port.
- Key Learning: Syslog pinpoints root cause rapidly—crucial for quick incident response.
Quick Guide: Configuring Syslog Server Integration (Cisco IOS)
- Identify your syslog server IP, e.g., 192.168.1.100.
- Configure logging host and severity:
configure terminal logging host 192.168.1.100 logging trap informational logging on end
- Optionally set the source interface:
configure terminal logging source-interface Vlan1 end
- Sync time using NTP:
configure terminal ntp server 192.168.1.1 service timestamps log datetime msec end
- Verify with
show logging
.
Tip: Use centralized syslog for compliance and security monitoring!
Exam Tips and Key Points
- Memorize syslog severity levels (0–7) and meaning.
- Interpret
show logging
fields (timestamp, facility, severity, content). - Know how to configure logging destinations and filters for effective monitoring.
- Understand buffer sizing, NTP/time sync, and log security best practices.
- Always start troubleshooting with
show logging
—focus first on high-severity (0–3) messages. - Use syslog server integration for centralization, compliance, and deep analysis.