1 /* 2 * Copyright (c) 1982, 1986, 1988 Regents of the University of California. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms are permitted 6 * provided that this notice is preserved and that due credit is given 7 * to the University of California at Berkeley. The name of the University 8 * may not be used to endorse or promote products derived from this 9 * software without specific prior written permission. This software 10 * is provided ``as is'' without express or implied warranty. 11 * 12 * @(#)syslog.h 7.9 (Berkeley) 06/06/88 13 */ 14 15 /* 16 * Facility codes 17 */ 18 19 #define LOG_KERN (0<<3) /* kernel messages */ 20 #define LOG_USER (1<<3) /* random user-level messages */ 21 #define LOG_MAIL (2<<3) /* mail system */ 22 #define LOG_DAEMON (3<<3) /* system daemons */ 23 #define LOG_AUTH (4<<3) /* security/authorization messages */ 24 #define LOG_SYSLOG (5<<3) /* messages generated internally by syslogd */ 25 #define LOG_LPR (6<<3) /* line printer subsystem */ 26 #define LOG_NEWS (7<<3) /* network news subsystem */ 27 #define LOG_UUCP (8<<3) /* UUCP subsystem */ 28 /* other codes through 15 reserved for system use */ 29 #define LOG_LOCAL0 (16<<3) /* reserved for local use */ 30 #define LOG_LOCAL1 (17<<3) /* reserved for local use */ 31 #define LOG_LOCAL2 (18<<3) /* reserved for local use */ 32 #define LOG_LOCAL3 (19<<3) /* reserved for local use */ 33 #define LOG_LOCAL4 (20<<3) /* reserved for local use */ 34 #define LOG_LOCAL5 (21<<3) /* reserved for local use */ 35 #define LOG_LOCAL6 (22<<3) /* reserved for local use */ 36 #define LOG_LOCAL7 (23<<3) /* reserved for local use */ 37 38 #define LOG_NFACILITIES 24 /* maximum number of facilities */ 39 #define LOG_FACMASK 0x03f8 /* mask to extract facility part */ 40 41 #define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3) /* facility of pri */ 42 43 /* 44 * Priorities (these are ordered) 45 */ 46 47 #define LOG_EMERG 0 /* system is unusable */ 48 #define LOG_ALERT 1 /* action must be taken immediately */ 49 #define LOG_CRIT 2 /* critical conditions */ 50 #define LOG_ERR 3 /* error conditions */ 51 #define LOG_WARNING 4 /* warning conditions */ 52 #define LOG_NOTICE 5 /* normal but signification condition */ 53 #define LOG_INFO 6 /* informational */ 54 #define LOG_DEBUG 7 /* debug-level messages */ 55 56 #define LOG_PRIMASK 0x0007 /* mask to extract priority part (internal) */ 57 #define LOG_PRI(p) ((p) & LOG_PRIMASK) /* extract priority */ 58 59 #define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri)) 60 61 #ifdef KERNEL 62 #define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */ 63 #endif 64 65 /* 66 * Option flags for openlog. 67 * 68 * LOG_ODELAY no longer does anything; LOG_NDELAY is the 69 * inverse of what it used to be. 70 */ 71 #define LOG_PID 0x01 /* log the pid with each message */ 72 #define LOG_CONS 0x02 /* log on the console if errors in sending */ 73 #define LOG_ODELAY 0x04 /* delay open until first syslog() (default) */ 74 #define LOG_NDELAY 0x08 /* don't delay open */ 75 #define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */ 76