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