2.11. Configuring syslog
Overview
Function Introduction
The system message logging software can save messages in a log file or direct the messages to other devices. The system message logging facility has these features:
Provides you with logging information for monitoring and troubleshooting.
Allows you to select the types of logging information that is captured.
Allows you to select the destination of the captured logging information.
By default, the switch logs normal but significant system messages to its internal buffer and sends these messages to the system console. You can specify which system messages should be saved based on the type of the severity level. The messages are time-stamped to enhance real-time debugging and management.
You can access the logged system messages using the switch command-line interface (CLI) or by saving them to a properly configured log server. The switch software saves the log messages in an internal buffer that can store up to 1000 messages. You can monitor the system messages remotely by accessing the switch through Telnet or the console port, or by viewing the logs on a log server.
Principle Description
Terminology:
Terminology |
Description |
---|---|
Logging |
Current logging configuration |
Show |
Show logging configuration |
Levels |
Severity level information |
Enable |
Enable write log to local file |
Disable |
Disable write log to local file |
System Message Log Facility Types
Facility Name |
Definition |
---|---|
kern |
kernel messages |
user |
random user-level messages |
mail system |
|
daemon |
system daemons |
auth |
security/authorization messages |
syslog |
messages generated internally by syslogd |
lpr |
line printer subsystem |
news |
network news subsystem |
uucp |
UUCP subsystem |
cron |
clock daemon |
authpriv |
security/authorization messages (private) |
ftp |
ftp daemon |
Severity Level Definitions
Severity Level |
Definition |
---|---|
emergency |
system is unusable |
alert |
action must be taken immediately |
critical |
critical conditions |
error |
error conditions |
warning |
warning conditions |
notice |
normal but significant condition |
information |
Informational |
debug |
debug-level messages |
Configuration
Configuring Logging server
step 1 Enter the configure mode
Switch# configure terminal
step 2 Enable logging server and set the attributes
Switch(config)# logging server enable
Switch(config)# logging server address 1.1.1.1
Switch(config)# logging server address 2001:1000::2
Switch(config)# logging server severity debug
Switch(config)# logging server facility mail
step 3 Exit the configure mode
Switch(config)# end
step 4 Validation
Switch# show logging
Current logging configuration:
============================================================
logging buffer 500
logging timestamp bsd
logging file enable
logging level file warning
logging level module debug
logging server enable
logging server severity debug
logging server facility mail
logging server address 1.1.1.1
logging server address 2001:1000::2
logging alarm-trap enable
logging alarm-trap level middle
logging merge enable
logging merge fifo-size 1024
logging merge timeout 10
logging operate disable
Configuring Logging Buffer Size
By default, the number of messages to log to the logging buffer is 500. If desired, you can set the number between 10 and 1000.
step 1 Enter the configure mode
Switch# configure terminal
step 2 Set the logging Buffer Size
Switch(config)# logging buffer 700
step 3 Exit the configure mode
Switch(config)# end
step 4 Validation
Switch# show logging
Current logging configuration:
============================================================
logging buffer 700
logging timestamp bsd
logging file enable
logging level file warning
logging level module debug
logging server enable
logging server severity debug
logging server facility mail
logging server address 1.1.1.1
logging alarm-trap enable
logging alarm-trap level middle
logging merge enable
logging merge fifo-size 1024
logging merge timeout 10
logging operate disable
The following is the information of logging server:
Application cases
N/A