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