[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: LDAP Debug messages & severity levels

On Fri, 2005-09-16 at 18:38 +0200, Hallvard B Furuseth wrote:
> ...


did you get any far with your logging redesign?  I'm asking because
we're currently facing the same problem, and it's getting pretty urgent.
If you already started coding, I'd be happy to jump in and contribute;
otherwise, I'd start a similar activity.  In my design, the
infrastructure to support it will be very light; moreover, there will be
no need to change __all__ statements: on the contrary, existing Debug()
statements would just have a neutral, default behavior; this means no
#ifdefs, no NEW_LOGGING style intrusivity and so.


- keep the "loglevel" notion; messages that always have to be logged
will use LDAP_DEBUG_ANY;

- add the "severity" notion, mapped (essentially) 1:1 to syslog's

- old Debug() macros will log for their loglevel and at
ldap_syslog_level, which is now set to LOG_DEBUG but should be
customizable to any of syslog's levels;

- new macros will either allow for severity, or use friendly names like
in your design (I haven't decided yet: naming seems friendly and allows
to change the underlying syslog level, but using LDAP_SYSLOG_* looks
more direct to me).

- the original behavior would be restored by setting all LDAP_SYSLOG_*
macros to LOG_DEBUG.

Since this does not require to change all logging invocations at once, I
think it would easily fit in OpenLDAP 2.3 and get to release way before
transition is all done; there would be no need to hide anything behind
dedicated #ifdefs, because the traditional behavior can be restored
either at configure or even run-time (LDAP_SYSLOG_* can be vars instead
of macros...).

I haven't yet considered the implications of --disable-debug, though.


Ing. Pierangelo Masarati
Responsabile Open Solution
OpenLDAP Core Team

SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
Office:   +39.02.23998309          
Mobile:   +39.333.4963172
Email:    pierangelo.masarati@sys-net.it