BSD 4_3_Tahoe release
[unix-history] / usr / src / sys / h / syslog.h
CommitLineData
da7c5cc6 1/*
c2285ffd
KB
2 * Copyright (c) 1982, 1986, 1988 Regents of the University of California.
3 * All rights reserved.
da7c5cc6 4 *
c2285ffd 5 * Redistribution and use in source and binary forms are permitted
50c7758a
KB
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
c2285ffd 16 *
ca67e7b4 17 * @(#)syslog.h 7.10 (Berkeley) 6/27/88
da7c5cc6 18 */
6e764a2d
SL
19
20/*
a38b822e 21 * Facility codes
6e764a2d
SL
22 */
23
a38b822e
EA
24#define LOG_KERN (0<<3) /* kernel messages */
25#define LOG_USER (1<<3) /* random user-level messages */
26#define LOG_MAIL (2<<3) /* mail system */
27#define LOG_DAEMON (3<<3) /* system daemons */
28#define LOG_AUTH (4<<3) /* security/authorization messages */
674e54ed 29#define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */
90c7f8bb 30#define LOG_LPR (6<<3) /* line printer subsystem */
fb258097 31#define LOG_NEWS (7<<3) /* network news subsystem */
38d0e8e6 32#define LOG_UUCP (8<<3) /* UUCP subsystem */
674e54ed 33 /* other codes through 15 reserved for system use */
a38b822e
EA
34#define LOG_LOCAL0 (16<<3) /* reserved for local use */
35#define LOG_LOCAL1 (17<<3) /* reserved for local use */
36#define LOG_LOCAL2 (18<<3) /* reserved for local use */
37#define LOG_LOCAL3 (19<<3) /* reserved for local use */
38#define LOG_LOCAL4 (20<<3) /* reserved for local use */
39#define LOG_LOCAL5 (21<<3) /* reserved for local use */
40#define LOG_LOCAL6 (22<<3) /* reserved for local use */
41#define LOG_LOCAL7 (23<<3) /* reserved for local use */
a3d8e4b9 42
a38b822e
EA
43#define LOG_NFACILITIES 24 /* maximum number of facilities */
44#define LOG_FACMASK 0x03f8 /* mask to extract facility part */
a3d8e4b9 45
736a2d73
MK
46#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) /* facility of pri */
47
a38b822e
EA
48/*
49 * Priorities (these are ordered)
50 */
a3d8e4b9 51
a38b822e
EA
52#define LOG_EMERG 0 /* system is unusable */
53#define LOG_ALERT 1 /* action must be taken immediately */
54#define LOG_CRIT 2 /* critical conditions */
55#define LOG_ERR 3 /* error conditions */
56#define LOG_WARNING 4 /* warning conditions */
57#define LOG_NOTICE 5 /* normal but signification condition */
58#define LOG_INFO 6 /* informational */
59#define LOG_DEBUG 7 /* debug-level messages */
a3d8e4b9 60
22cbdb4b 61#define LOG_PRIMASK 0x0007 /* mask to extract priority part (internal) */
736a2d73
MK
62#define LOG_PRI(p) ((p) & LOG_PRIMASK) /* extract priority */
63
64#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
65
66#ifdef KERNEL
67#define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */
68#endif
22cbdb4b 69
5785ae9e
SL
70/*
71 * arguments to setlogmask.
72 */
73#define LOG_MASK(pri) (1 << (pri)) /* mask for one priority */
74#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1) /* all priorities through pri */
75
6e764a2d 76/*
58210366 77 * Option flags for openlog.
9facce49
EA
78 *
79 * LOG_ODELAY no longer does anything; LOG_NDELAY is the
80 * inverse of what it used to be.
6e764a2d 81 */
c1456a5d
MK
82#define LOG_PID 0x01 /* log the pid with each message */
83#define LOG_CONS 0x02 /* log on the console if errors in sending */
e2959b33 84#define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */
c1456a5d
MK
85#define LOG_NDELAY 0x08 /* don't delay open */
86#define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */