@@ -295,6 +295,10 @@ private <T> LdapSearchResult<T> lookup(String dn, String filter, String[] attrib
295
295
return lookup (dn , filter , attributes , mapper , 0 );
296
296
}
297
297
298
+ private String getSearchDescription (String dn , String filter , String [] attributes ) {
299
+ return "DN: " + dn + " , filter: " + filter + " , attributes: " + String .join ("," , attributes );
300
+ }
301
+
298
302
/**
299
303
* Lookups the LDAP server for content.
300
304
*
@@ -354,7 +358,8 @@ private <T> LdapSearchResult<T> lookup(String dn, String filter, String[] attrib
354
358
return new LdapSearchResult <>(sr .getNameInNamespace (), processResult (sr , mapper ));
355
359
}
356
360
} catch (NameNotFoundException ex ) {
357
- LOGGER .log (Level .WARNING , String .format ("The LDAP name was not found on server %s" , server ), ex );
361
+ LOGGER .log (Level .WARNING , String .format ("The LDAP name for search '%s' was not found on server %s" ,
362
+ getSearchDescription (dn , filter , attributes ), server ), ex );
358
363
throw new LdapException ("The LDAP name was not found." , ex );
359
364
} catch (SizeLimitExceededException ex ) {
360
365
LOGGER .log (Level .SEVERE , String .format ("The maximum size of the LDAP result has exceeded "
@@ -375,8 +380,8 @@ private <T> LdapSearchResult<T> lookup(String dn, String filter, String[] attrib
375
380
actualServer = getNextServer ();
376
381
return lookup (dn , filter , attributes , mapper , fail + 1 );
377
382
} catch (NamingException ex ) {
378
- LOGGER .log (Level .SEVERE , String .format ("An arbitrary LDAP error occurred on server %s" ,
379
- server ), ex );
383
+ LOGGER .log (Level .SEVERE , String .format ("An arbitrary LDAP error occurred on server %s " +
384
+ "when searching for '%s'" , getSearchDescription ( dn , filter , attributes ), server ), ex );
380
385
closeActualServer ();
381
386
actualServer = getNextServer ();
382
387
return lookup (dn , filter , attributes , mapper , fail + 1 );
0 commit comments