Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use syslog to log messages coming from my PHP based site. My question is - can I add custom facility name? I know there are predefined facilities like:

auth, authpriv, cron, dæmon, kern, lpr, mail, mark, news, syslog, user, UUCP and local0 through local7.

And as I understand I could use local0 - local6 facilities for this.

But I just feel that if I could add something like this to syslog:

mySiteName.* /var/log/mySiteName.log

It would be visually easier to understand for others. Unfortunately above line results in:

rsyslogd-3000: unknown facility name "mySiteName"

So - is there a way to use custom facility name?

share|improve this question
up vote 20 down vote accepted

The syslog interface only allows a fixed set of facilities, defined by constants in /usr/include/sys/syslog.h. The only provision for custom facilities are local0 through local7.

What you can do to separate the logs of various servers is use filters to match on the origin or text of each log message. Rsyslog has fairly powerful filters (read the properties available for matching).

share|improve this answer

Not exactly applying to the question but hopefully useful example for daemons not providing their own facility:

:programname, isequal, "uptimed" /var/log/uptimed.log
share|improve this answer
Which syslog implementation are you referring to? (Or is this standard?) – sr_ Apr 25 '12 at 11:23
Adding this line to /etc/rsyslog.conf worked with rsyslogd 8.4.2 – ztk 2 days ago

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.