We have about 10 different daemons for which we would like to use syslog logging. It looks like that for custom applications you’re supposed to use LOCAL0..LOCAL7 facilities. Well, how can one then differentiate between those 10 daemons if he has only 8 possible “sockets”?
For example, if we’d like to have one /var/log/daemon<x> file per each daemon.
Don’t use different
syslogfacilities for that. Instead, passLOG_PIDoption to openlog and configure appropriately your logger daemon thru syslog.conf, or perhaps use rsyslog or some other syslogger (there are many of them).openloghas aidentargument which can be used by logger dameons for discrimination & filtering of log messages.And alternative would be to conventionally decide that logging should go to some application specific file under
/var/log(i.e. use just<stdio.h>withfopen,fprintfbut don’t forgetfflush). This is what many Linux servers (exim4,lighttpd,Xorg, …) are doing. See also the Linux Standard Base which defines conventions.