• Contact Us
  • Home
  • Installation
  • Troubleshooting

How To Use Debug Logging

Written by Maryanne Normann

Updated at October 9th, 2025

  • Quick Start
  • Installation
    Best Practices Configuration Troubleshooting Design Performance Platform
  • Maintenance
    Releases Upgrade
  • Reference
+ More

There are two ways to send and store loggin messages. The logging directives are specified in the global section of the slapd.conf (or cn=config for dynamic configuration).

  • The loglevel directive specifies the level of debugging and the messages generated are then sent to syslog. 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 in slapd.conf is as follows:
loglevel    stats sync
  • 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 default options are overriden in /etc/default/symas-openldap by adding SLAPD_OPTIONS="-d <loglevel>". The logfile syntax in slapd.conf is as follows.(debugging) option selected. The syntax is as follows:
logfile     /path/to/the/logfile.log

To indicate whether or not the messages should go only to the specified logfile or to stderr as well use the logfile-only directive

logfile-only	on | off

To define the logfile rotation use the logfile-rotate directive

logfile-rotate <max> <Mbytes> <hours>

Available loglevels used in the configuration file or in slapd-options in /etc/defaults/symas-openldap are defined as follows:

  **-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:

loglevel 16640

loglevel 0x4100

 as a list of integers:

loglevel 256 16384

loglevel 0x100 0x4000

 or as a list of the names that are shown between brackets:

loglevel stats sync

See Symas OpenLDAP 2.6 Logging for setting options for cn=config

Copyright © 2020-2024 Symas Corporation. All rights reserved.
debug logs

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Logging Configuration for RHEL / Centos
  • Configuring iptables (Opening LDAP Ports)
  • Overview of TLS and LDAPS
  • Symas Blog RSS Feed
  • Symas on Facebook
  • Symas on Twitter
  • Symas Blog
  • Symas on LinkedIn
  • Symas YouTube Channel

Copyright © 2025, Symas Corporation. All rights reserved. Privacy Statement (updated July 31, 2023)

Phone:

Main Office: +1.650.963.7601
Fax: +1.650.390.6284

Email:

Sales: sales@symas.com
Support: support@symas.com

Office Hours:

8:00 AM - 5:00 PM ET

Office Location:

Symas Corporation
PO Box 391
Grand Junction, CO 81507 USA

Expand