Syslog Local Facility

Local facilities are part of the Linux operating system. You may choose from local0 Through local7. Below is an example of using a local facility to route logging to the appropriate place on your system.

# Save boot messages also to boot.log
local7.*                                                /var/log/boot.log

This will send all local7 facility logging to /var/log/boot.log. Be careful, because local0 through local7 overlap with some of the other built in facilities with the system such as kern, authpriv, or mail.

The last few local facilities are open for your use and not utilized by the system. When programming a custom application you can utilize these facilities. For example, local6 can be used for the stderr of your application, and subsequently funneled to your /var/log directory. This is often times used in C or PERL programs that support local facility integration directly into the operating system.

Finally, the other nice feature is that you can forward local facility logs to a remote host, for example instead of specifying a path simply specify “@some_ip_address” and make sure the appropriate ports are open on the other server.

Be the first to comment

Leave a Reply