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
Router(config)#
172.25.1.1
logging facility
Router(config)#
local6
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
Facility | Description |
---|---|
Auth | Authorization system |
Cron | Cron/at facility |
Daemon | System daemons |
Kern | Kernel |
local0 | Local use |
local1 | Local use |
local2 | Local use |
local3 | Local use |
local4 | Local use |
local5 | Local use |
local6 | Local use |
local7 | Local use (Default facility for Cisco routers) |
Lpr | Line printer system |
Mail system | |
News | USENET news |
sys9 | System use |
sys10 | System use |
sys11 | System use |
sys12 | System use |
sys13 | System use |
sys14 | System use |
Syslog | Syslog itself |
User | User process |
Uucp | Unix-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.