December 2007
M T W T F S S
« Nov   Mar »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

How to enable logging in Python LDAP

13:59 on Tue 2007-12-18 by Leons Petrazickis Python

When writing Python scripts which rely on python-ldap and openLDAP, it is often useful to turn on debug messages as follows: import ldap; # enable python-ldap logging ldap.set_option(ldap.OPT_DEBUG_LEVEL, 4095) # enable openLDAP logging l = ldap.initialize(‘ldap://yourserver:port’, trace_level=2)   This is also useful when debugging the LDAP Plugin for Trac.