Symas OpenLDAP Knowledge Base

HowTo Use Debug Logging

Content TBD


The logging block is the last in the global section of the slapd.conf file. It contains the logfile (optional) and loglevel directives.

The logfile directive provides the location where logs should be saved for debugging purposes. For regular slapd operation, the logfile setting does not override the logging location specified in the syslog/rsyslog configuration. It only comes into play when slapd, solserver or any of the other program or object level commands are performed with the -d (debugging) option selected. The syntax is as follows:

    logfile     /path/to/the/logfile.log

The loglevel defaults to stats. This level should usually also be included when using other loglevels, to help analyze the logs and is recommended for all environments. The loglevels stats and sync are recommended for replicated environments. The loglevel syntax is as follows:

    loglevel    stats sync

NOTE: Following 2.4.44-1 release of Symas OpenLDAP, the stats loglevel also includes limited sync* *logging. This change reduces the performance hit of logging both stats and sync information, while providing adequate information to troubleshoot sync replication failures and errors.

This setting specifies the level at which debugging statements and operation statistics should be syslogged (currently logged to the syslogd LOG_LOCAL4 facility). Available log levels are:

  **-1**     **(any)**            *Enables logging at all levels*
  **0**      **(none)**           *No logging occurs*
  **1**      **(0x1)(trace)**     *Trace function calls*
  **2**      **(0x2)(packets)**   *Debug packet handling*
  **4**      **(0x4)(args)**      *Heavy trace debugging (function args)*
  **8**      **(0x8)(conns)**     *Connection management*
  **16**     **(0x10)(BER)**      *Print out packets sent and received*
  **32**     **(0x20)(filter)**   *Search filter processing*
  **64**     **(0x40)(config)**   *Configuration file processing*
  **128**    **(0x80)(ACL)**      *Access control list processing*
  **256**    **(0x100)(stats)**   *Connections, LDAP operations, results (recommended)*
  **512**    **(0x200)(stats2)**  *Stats log entries sent*
  **1024**   **(0x400)(shell)**   *Print communication with shell backends*
  **2048**   **(0x800)(parse)**   *Entry parsing*
  **16384**  **(0x4000)(sync)**   *LDAPSync replication*
  **3278**   **(0x8000)(none)**   *Only messages that get logged whatever log level is set* 

The desired log level can be input as a single integer that combines the desired levels, both in decimal or in hexadecimal notation, as a list of integers or as a list of the names that are shown between brackets. The example syntax below are the loglevel stats and sync

    loglevel stats sync
    loglevel 16640
    loglevel 0x4100
    loglevel 256 16384
    loglevel 0x100 0x4000