[Date Prev][Date Next]
RE: slapd logging
Sorry, this was supposed to go to the list, and I just
sent it to Kurt...
What I did for my Java logging was create a class that
uses a hash map to store the requested logging by mnemonic:
Anyway, something similar could be done in C. Just keep
an array of requested logging subsystems. Instead of
just true/false, an integer level could be maintained.
I think this is complex enough that it should be supported
in the configuration file, with overrides on the command
line. Something like
(I'm sure -D is taken, but whatever character is available)
slapd -D acl=4 ...
Then the Log prototype would be as you suggest.
Oh, and there's a special subsystem, All that turns on
debugging for all subsystems:
so all subsystems would have a minimum debugging level
of 5 in this case.
> -----Original Message-----
> From: Kurt D. Zeilenga [mailto:Kurt@OpenLDAP.org]
> Sent: Tuesday, September 26, 2000 2:47 PM
> To: openldap-devel@OpenLDAP.org
> Subject: RE: slapd logging
> I'd like to see a well thought out logging design... (and, no,
> I'm not volunteering :-).
> One approach would be to have:
> 1) a global "level" (e.g.
> 2) per subsystem levels (same levels as above) where each
> library (lber,ldap,lutil,etc), each backend, plus ACL, schema
> Each log message would be written like:
> Log( LOG_SUBSYS, LOG_LEVEL, "format", ...);
> The check would be:
> ( level >= global_level || level >= subsys_level[subsys] )
> and would be enabled using:
> -l level
> -l subsys:level
> -l subsysA,subsysB:levelX;subsysC:levelY;level
> and/or as multiple, combined arguments.
> There are other workable alternatives...