Tracing and debugging LDAP client APIs
You can enable tracing for LDAP client application programming interfaces (APIs) and use the information that is captured in the trace file to debug problems.
Before you begin
Procedure
- Set the appropriate debug level by using the
LDAP_DEBUGenvironment variable.- On AIX®, Linux®, and Solaris operating systems
$export LDAP_DEBUG=debug_level- On Windows platform
c:\>set LDAP_DEBUG=debug_level
The different debug levels for various categories are provided in the following table.
Table 1. Debug levels Decimal Value Description 1 LDAP_DEBUG_TRACEEntry and exit from routines 2 LDAP_DEBUG_PACKETSPacket activity 4 LDAP_DEBUG_ARGSData arguments from requests 8 LDAP_DEBUG_CONNSConnection activity 16 LDAP_DEBUG_BEREncoding and decoding of data 32 LDAP_DEBUG_FILTERSearch filters 64 LDAP_DEBUG_MESSAGEMessaging subsystem activities and events 128 LDAP_DEBUG_ACLAccess Control List activities 256 LDAP_DEBUG_STATSOperational statistics 512 LDAP_DEBUG_THREADThreading statistics 1024 LDAP_DEBUG_REPLReplication statistics 2048 LDAP_DEBUG_PARSEParsing activities 4096 LDAP_DEBUG_PERFORMANCERelational back-end performance statistics 8192 LDAP_DEBUG_RDBMRelational back-end activities (RDBM) 16384 LDAP_DEBUG_REFERRALReferral activities 32768 LDAP_DEBUG_ERRORError conditions 65535 LDAP_DEBUG_ANYAll levels of debug For example, specifying a bit mask value of 65535 turns on full debug output and generates the most complete information. To know more about debug levels, see Server debug mode. - Set the debug file name by using the
LDAP_DEBUG_FILEenvironment variable.- On AIX, Linux, and Solaris operating systems
$export LDAP_DEBUG_FILE=filename- ON Windows platform
c:\>set LDAP_DEBUG_FILE=filename
Note: Ensure that your client application has write access to this file. - Run the application from the same terminal where you have environment set. Re-create the problem that you want to debug.
- The debug information is captured in the file pointed
by the
LDAP_DEBUG_FILEenvironment variable. You can now use the information that is captured in the file to debug the problem. Or send this file to the IBM Support team for further analysis.