spring-projects / spring-ldap

Spring LDAP
https://spring.io/spring-ldap
Apache License 2.0
347 stars 483 forks source link

LDAP-310: Log LDAP queries generated by spring-ldap #345

Closed spring-projects-issues closed 9 months ago

spring-projects-issues commented 10 years ago

Jose Martinez (Migrated from LDAP-310) said:

I would be useful for the debugging purposes to have log the final query string sent to the server as well as the parameters. Something we can copy-paste into the LDAP server and see how it runs. Similar to the way JdbcTemplate shows the queries and parameters executing a query.

I'm creating this Jira as per the following StackOverflow post: https://stackoverflow.com/questions/24061834/how-to-see-the-query-generated-by-spring-ldaptemplate.

StevenByks commented 7 years ago

I was trying to figure out how to turn on extra logging, and came across that exact SO post, which lead me here. Debug logging would be so incredibly useful.

kkrawczy commented 7 years ago

+1, I also find it useful to see ldap queries.

gael-ft commented 6 years ago

+1

nunoc commented 6 years ago

+1

hanusto commented 6 years ago

+1

chupetoide commented 6 years ago

+1

kutis96 commented 6 years ago

+1

erdbeerschnitzel commented 6 years ago

+2 :)

rwinch commented 6 years ago

Does someone want to create a PR for this?

ggauravag commented 6 years ago

+1

naorbar commented 6 years ago

Rob, I'll take a look... Naor

mastermind3043-zz commented 4 years ago

+1

tofuatjava commented 3 years ago

+1

lafferty-common commented 3 years ago

+1

khafizovar commented 3 years ago

+1

KrashLeviathan commented 2 years ago

+1 Has this really been an open issue for 8 years?

One workaround for manual searches is to log the Filter returned by LdapQuery.filter().

LdapQuery query = query().where("someAttribute").is("some value")
    .and(query().where("objectClass").not().is("unwanted"));
log.debug("LDAP query: " + query.filter());
List<?> results = repository.findAll(query);

...logs...

LDAP query: (&(someAttribute=some value)(!(objectClass=unwanted)))
ranma2913 commented 1 year ago

+1 again. Having trouble understanding the ldap query behavior when comparing what ApacheDirectoryStudio returns vs. Spring-Data-LDAP.