52-11
Software Configuration Guide—Release 15.0(2)SG
OL-23818-01
Chapter 52 Configuring System Message Logging Configuring System Message Logging
Log in as root, and perform these steps:
Step 1 Add a line such as the following to the file /etc/syslog.conf:
local7.debug /usr/adm/logs/cisco.log
The local7 keyword specifies the logging facility to be used; see Table 52-4 on page 52-12 for
information on the facilities. The debug keyword specifies the syslog level; see Table 52-3 on page 52-9
for information on the severity levels. The syslog daemon sends messages at this level or at a more severe
level to the file specified in the next field. The file must already exist, and the syslog daemon must have
permission to write to it.
Step 2 Create the log file by entering these commands at the UNIX shell prompt:
$ touch /var/log/cisco.log
$ chmod 666 /var/log/cisco.log
Step 3 Ensure that the syslog daemon reads the new changes:
$ kill -HUP `cat /etc/syslog.pid`
For more information, see the man syslog.conf and man syslogd commands on your UNIX system.
Configuring the UNIX System Logging Facility
When sending system log messages to an external device, you can cause the switch to identify its
messages as originating from any of the UNIX syslog facilities.
To configure UNIX system facility message logging, perform this task (which is optional):
Command Purpose
Step 1 Switch# configure terminal Enters global configuration mode.
Step 2 Switch(config)# logging host Logs messages to a UNIX syslog server host by
entering its IP address.
To build a list of syslog servers that receive logging
messages, enter this command more than once.
Step 3 Switch(config)# logging trap level Limits messages logged to the syslog servers.
Be default, syslog servers receive informational
messages and lower. See Table 52-3 on page 52-9 for
level keywords.
Step 4 Switch(config)# logging facility facility-type Configures the syslog facility. See Table 52-4 on
page 52-12 for facility-type keywords.
The default is local7.
Step 5 Switch(config)# end Returns to privileged EXEC mode.
Step 6 Switch# show running-config Verifies your entries.
Step 7 Switch# copy running-config startup-config (Optional) Saves your entries in the configuration file.