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

Before you enable tracing for LDAP client APIs, you must first stop the LDAP client application.

Procedure

  1. Set the appropriate debug level by using the LDAP_DEBUG environment 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_TRACE Entry and exit from routines
    2 LDAP_DEBUG_PACKETS Packet activity
    4 LDAP_DEBUG_ARGS Data arguments from requests
    8 LDAP_DEBUG_CONNS Connection activity
    16 LDAP_DEBUG_BER Encoding and decoding of data
    32 LDAP_DEBUG_FILTER Search filters
    64 LDAP_DEBUG_MESSAGE Messaging subsystem activities and events
    128 LDAP_DEBUG_ACL Access Control List activities
    256 LDAP_DEBUG_STATS Operational statistics
    512 LDAP_DEBUG_THREAD Threading statistics
    1024 LDAP_DEBUG_REPL Replication statistics
    2048 LDAP_DEBUG_PARSE Parsing activities
    4096 LDAP_DEBUG_PERFORMANCE Relational back-end performance statistics
    8192 LDAP_DEBUG_RDBM Relational back-end activities (RDBM)
    16384 LDAP_DEBUG_REFERRAL Referral activities
    32768 LDAP_DEBUG_ERROR Error conditions
    65535 LDAP_DEBUG_ANY All 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.
  2. Set the debug file name by using the LDAP_DEBUG_FILE environment 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.
  3. Run the application from the same terminal where you have environment set. Re-create the problem that you want to debug.
  4. The debug information is captured in the file pointed by the LDAP_DEBUG_FILE environment 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.