Refactored ldap logging.