Changing the Default Log Facility

Problem

You want to change the default logging facility.

Solution

Use the logging facility configuration command to change the syslog facility that the router sends error messages to:

Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#logging host 172.25.1.1
Router(config)#logging facility local6
Router(config)#end 
Router#

The default syslog facility setting is local7.

Discussion

By default, the router will forward all syslog messages to the server’s local7 log facility. You can modify this behavior and forward all of your router’s syslog messages to another facility by utilizing the logging facility configuration command. Table 18-3 illustrates the possible logging facilities that a router will accept.

Table 18-3. Cisco logging facility types

FacilityDescription
AuthAuthorization system
CronCron/at facility
DaemonSystem daemons
KernKernel
local0Local use
local1Local use
local2Local use
local3Local use
local4Local use
local5Local use
local6Local use
local7Local use (Default facility for Cisco routers)
LprLine printer system
MailMail system
NewsUSENET news
sys9System use
sys10System use
sys11System use
sys12System use
sys13System use
sys14System use
SyslogSyslog itself
UserUser process
UucpUnix-to-Unix copy system

Tip

We generally recommend that you choose one of the “local” facilities, as these are intended specifically for this type of use.

There are a number of reasons why it can be quite useful to choose a facility other than the ...

Get Cisco IOS Cookbook, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.