xref: /illumos-gate/usr/src/lib/libldap5/include/ldap/log.h (revision e7cbe64f7a72dae5cb44f100db60ca88f3313c65)
1 #pragma ident	"%Z%%M%	%I%	%E% SMI"
2 
3 #ifndef _LLOG_H
4 #define _LLOG_H
5 
6 
7 #include <stdio.h>
8 #include <sys/types.h>
9 #include <sys/stat.h>
10 #include <nl_types.h>
11 #include <limits.h>
12 #include <syslog.h>
13 #include <portable.h>
14 
15 
16 
17 /* Log levels */
18 
19 /* slapd values */
20 #define LDAP_DEBUG_TRACE        0x001
21 #define LDAP_DEBUG_PACKETS      0x002
22 #define LDAP_DEBUG_ARGS         0x004
23 #define LDAP_DEBUG_CONNS        0x008
24 #define LDAP_DEBUG_BER          0x010
25 #define LDAP_DEBUG_FILTER       0x020
26 #define LDAP_DEBUG_CONFIG       0x040
27 #define LDAP_DEBUG_ACL          0x080
28 #define LDAP_DEBUG_STATS        0x100
29 #define LDAP_DEBUG_STATS2       0x200
30 #define LDAP_DEBUG_SHELL        0x400
31 #define LDAP_DEBUG_PARSE        0x800
32 /* More values for http gateway */
33 #define LDAP_DEBUG_GWAY		0x1000
34 #define LDAP_DEBUG_GWAYMORE	0x2000
35 /* Generic values */
36 #define LDAP_DEBUG_ANY		0xffff
37 
38 nl_catd	sundscat;
39 extern nl_catd	slapdcat;
40 extern void 	ldaplogconfig(char * logf, int size);
41 extern void	ldaplogconfigf(FILE *fd);
42 extern void	ldaploginit(char *name,
43 			int facility);
44 extern void	ldaploginitlevel(char *name,
45 			    int facility,
46 			    int log_level);
47 extern void 	ldaplog(int level,char *fmt,...);
48 
49 #define Statslog( level, fmt, connid, opid, arg1, arg2, arg3 )  \
50 { \
51 	if ( log_debug & level ) \
52 		fprintf( stderr, fmt, connid, opid, arg1, arg2, arg3 );\
53 	if ( log_syslog & level ) \
54 		ldaplog( level, fmt, connid, opid, arg1, arg2, arg3 ); \
55 }
56 #endif /* _LLOG_H */
57 
58 
59 
60