From: louie@sayshell.umd.edu (Louis A. Mamakos)
Subject: Re: Is there a list of facilities and levels for syslog?
Organization: University of Maryland, College Park
Date: Thu, 1 Oct 1992 18:37:48 GMT

In article <1992Sep29.180113.15788@menudo.uh.edu> sears@tree.egr.uh.edu writes:
>
>Is there a list anywhere of what facilities can be logged via the syslog  
>daemon?  There are possible 24 facilities (max defined in syslog.h) of which  
>15 are claimed by the system but only 7 make any sense.  Does anyone know what
>are the other 8 system facilities?  How do you use the 8 local facilities?
>
>#define LOG_KERN        (0<<3)  /* kernel messages */
>#define LOG_USER        (1<<3)  /* random user-level messages */
>#define LOG_MAIL        (2<<3)  /* mail system */
>#define LOG_DAEMON      (3<<3)  /* system daemons */
>#define LOG_AUTH        (4<<3)  /* security/authorization messages */
>#define LOG_SYSLOG      (5<<3)  /* messages generated internally by syslogd */
>#define LOG_LPR         (6<<3)  /* line printer subsystem */
>        /* other codes through 15 reserved for system use */
>#define LOG_LOCAL0      (16<<3) /* reserved for local use */
>#define LOG_LOCAL1      (17<<3) /* reserved for local use */
>#define LOG_LOCAL2      (18<<3) /* reserved for local use */
>#define LOG_LOCAL3      (19<<3) /* reserved for local use */
>#define LOG_LOCAL4      (20<<3) /* reserved for local use */
>#define LOG_LOCAL5      (21<<3) /* reserved for local use */
>#define LOG_LOCAL6      (22<<3) /* reserved for local use */
>#define LOG_LOCAL7      (23<<3) /* reserved for local use */

These are in fact all of the syslog facilities available.  Think of the
"facility" as an identification of the service or type of messages being
logged by a daemon or process or whatever.

The first few facilities (KERN, USER, MAIL, etc) are just well know 
facilities.  The LOCAL ones are just that: for local use.  For example, 
in a daemon that I run, I pass LOG_LOCAL3 to the openlog() function so
that I can easily catch messages to that facility to a seperate log file
as specified in the syslog.conf file.

>Is there and explaination of what different levels there are?  For example, I  
>know that debug has a lower priority than info, but what are all the levels  
>possible??  Are the only levels as follows:
>
>#define LOG_EMERG       0       /* system is unusable */
>#define LOG_ALERT       1       /* action must be taken immediately */
>#define LOG_CRIT        2       /* critical conditions */
>#define LOG_ERR         3       /* error conditions */
>#define LOG_WARNING     4       /* warning conditions */
>#define LOG_NOTICE      5       /* normal but signification condition */
>#define LOG_INFO        6       /* informational */
>#define LOG_DEBUG       7       /* debug-level messages */

There are in fact all of the level.  You don't *log* at more than one level
at a time in a given program.  When you invoke the syslog() function, you
pass a level which indicates the serverity of the message being logged.

The syslog daemon, on the other hand, has a way of specifing what
messages are actually saved to log files.  So, in syslogd, if you say
you want INFO messages saved, you also get NOTICE, WARNING, ERR, CRIT,
ALERT and EMERG messages as well; the idea being that if you are
interested in casual messages, you probably are interested in the more
important ones as well.  Messages logged at a less severe level than
you specified in the syslog.conf file are not saved.

louie