reduce logs

git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1412693 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-11-22 22:16:43 +00:00
parent 1747f702c9
commit d852fe3356
2 changed files with 10 additions and 5 deletions

View File

@ -98,7 +98,7 @@ public class LdapBindAuthenticator
+ ( mapper.getUserFilter() != null ? mapper.getUserFilter() : "" ) + "(" + mapper.getUserIdAttribute() + "=" + ( mapper.getUserFilter() != null ? mapper.getUserFilter() : "" ) + "(" + mapper.getUserIdAttribute() + "="
+ source.getPrincipal() + "))"; + source.getPrincipal() + "))";
log.info( "Searching for users with filter: '{}' from base dn: {}", filter, mapper.getUserBaseDn() ); log.debug( "Searching for users with filter: '{}' from base dn: {}", filter, mapper.getUserBaseDn() );
LdapConnection ldapConnection = getLdapConnection(); LdapConnection ldapConnection = getLdapConnection();
LdapConnection authLdapConnection = null; LdapConnection authLdapConnection = null;
@ -116,7 +116,7 @@ public class LdapBindAuthenticator
results = context.search( mapper.getUserBaseDn(), filter, ctls ); results = context.search( mapper.getUserBaseDn(), filter, ctls );
log.info( "Found user?: {}", results.hasMoreElements() ); log.debug( "Found user '{}': {}", source.getPrincipal(), results.hasMoreElements() );
if ( results.hasMoreElements() ) if ( results.hasMoreElements() )
{ {
@ -135,10 +135,12 @@ public class LdapBindAuthenticator
} }
} }
log.info( "Attempting Authenication: {}", userDn ); log.debug( "Attempting Authenication: {}", userDn );
authLdapConnection = connectionFactory.getConnection( userDn, source.getPassword() ); authLdapConnection = connectionFactory.getConnection( userDn, source.getPassword() );
log.info( "user '{}' authenticated", source.getPrincipal() );
return new AuthenticationResult( true, source.getPrincipal(), null ); return new AuthenticationResult( true, source.getPrincipal(), null );
} }
catch ( LdapException e ) catch ( LdapException e )

View File

@ -144,7 +144,7 @@ public class DefaultLdapController
String finalFilter = "(&(objectClass=" + mapper.getUserObjectClass() + ")" + String finalFilter = "(&(objectClass=" + mapper.getUserObjectClass() + ")" +
( mapper.getUserFilter() != null ? mapper.getUserFilter() : "" ) + query.getLdapFilter(mapper) + ")"; ( mapper.getUserFilter() != null ? mapper.getUserFilter() : "" ) + query.getLdapFilter(mapper) + ")";
log.info( "Searching for users with filter: \'{}\'" + " from base dn: {}",finalFilter, mapper.getUserBaseDn() ); log.debug( "Searching for users with filter: '{}'" + " from base dn: {}",finalFilter, mapper.getUserBaseDn() );
return context.search( mapper.getUserBaseDn(), finalFilter, ctls ); return context.search( mapper.getUserBaseDn(), finalFilter, ctls );
} }
@ -257,7 +257,8 @@ public class DefaultLdapController
{ {
String username = key.toString(); String username = key.toString();
log.info( "Searching for user: {}", username ); log.debug( "Searching for user: {}", username );
LdapUserQuery query = new LdapUserQuery(); LdapUserQuery query = new LdapUserQuery();
query.setUsername( username ); query.setUsername( username );
@ -270,6 +271,8 @@ public class DefaultLdapController
{ {
SearchResult next = result.nextElement(); SearchResult next = result.nextElement();
log.info( "Found user: {}", username );
return mapper.getUser( next.getAttributes() ); return mapper.getUser( next.getAttributes() );
} }
else else