LdapBundle icon indicating copy to clipboard operation
LdapBundle copied to clipboard

Detailed Logging

Open ofbeaton opened this issue 12 years ago • 1 comments

Please allow us to configure more detailed logging. Most problems are from configuration problems, but without good logs it is hard to know what the problem is.

The first request would be to allow us to change the LDAP logging level before the ldap_connect call.

ldap_set_option(null, LDAP_OPT_DEBUG_LVL, 7);

7 is the most verbose, so maybe make this user configurable?

Unfortunately the functions do not provide good errors and many are written directly to the screen. You need to capture them.

Before the ldap_connect call:

ob_start();

then before you throw an error, and before you exit out successfully, you will need to do a

log(ob_get_clean());

where log() is whatever logging function you use.

If a function like ldap_connect(), ldap_bind() or ldap_search() do fail (return false most of the time), it would be great if you could also put into the file the function error information:

log(__METHOD__.' ldap error ['.ldap_errno($connection).']: '.ldap_error($connection));

Other LDAP plugins for other frameworks allow for this kind of logging information, it is really useful as an administrator.

Also, I wonder if the hiding of all errors as a "Bad Credentials" is configurable in security.yml?

ofbeaton avatar Jun 21 '13 03:06 ofbeaton

Not forgotten but the time is currently missing.

BorisMorel avatar Jun 25 '13 08:06 BorisMorel