Linux – OpenLDAP debugging logs

linuxopenldap

I have OpenLDAP version 2.4.40 which is being cross compiled for a different (proprietary) target. This has been in place and working fine for many years but now I find myself needing to get some debugging from OpenLDAP to troubleshoot a memory leak which could potentially be in the OpenLDAP library itself.

I have searched high & low about how to get debugging from OpenLDAP logged into a file but every single thing I have found is always talking about SLAPD. We do not use SLAPD at all – it is not even compiled in. E.g., –disable-slapd is specified in the Makefile after running configure.

So even though I've tried things I have found related to getting debug information, none of it has worked and I'm guessing that is because what I have found is SLAPD specific.

I also have '–enable-debug=yes' configured.

NOTE also that we don't use the standard syslogd on the Linux target but rather a similar one called uxlogd which is pretty much our own as we have unique requirements not supported by syslogd.

Obviously I am not going to ask here any questions which is specific to our proprietary uxlogd but I would appreciate assistance on how to get debugging working solely from an OpenLDAP perspective. Since everything I have found is related to SLAPD I suspect I am not doing something correctly in configuring OpenLDAP conf files.

I am guessing I need to configure something in /etc/openldap/ldap.conf but I'm not sure what.

Any help is much appreciated.

Thanks
Allen

Best Answer

Shared libraries don't typically produce their own debug output by default - the programs that link them are supposed to take care of that, because they may use various ways to communicate to the user: the console, some sort of X output, syslog, ...

Did you try calling ldap_set_option(..., LDAP_OPT_DEBUG_LEVEL, LDAP_DEBUG_TRACE) from the program you link to the OpenLDAP library?

Per ldap.conf(5), there's no 1:1 mapping between those options and all the library options, and DEBUG_LEVEL isn't explicitly mentioned as available.

Related Topic