Merge pull request #820 from patriot1burke/master

remove info logging
This commit is contained in:
Bill Burke 2014-10-30 09:53:27 -04:00
commit a56cef47f2
14 changed files with 30 additions and 30 deletions

View file

@ -259,7 +259,7 @@ public class MongoStoreImpl implements MongoStore {
DBCollection dbCollection = getDBCollectionForType(type); DBCollection dbCollection = getDBCollectionForType(type);
BasicDBObject dbQuery = new BasicDBObject("_id", id); BasicDBObject dbQuery = new BasicDBObject("_id", id);
dbCollection.remove(dbQuery); dbCollection.remove(dbQuery);
logger.info("Entity of type: " + type + ", id: " + id + " removed from MongoDB."); //logger.debugf("Entity of type: %s , id: %s removed from MongoDB.", type, id);
context.addRemovedEntity(found); context.addRemovedEntity(found);
return true; return true;
@ -275,7 +275,7 @@ public class MongoStoreImpl implements MongoStore {
} else { } else {
DBCollection dbCollection = getDBCollectionForType(type); DBCollection dbCollection = getDBCollectionForType(type);
dbCollection.remove(query); dbCollection.remove(query);
logger.info("Removed " + foundObjects.size() + " entities of type: " + type + ", query: " + query); //logger.debug("Removed %d" + foundObjects.size() + " entities of type: " + type + ", query: " + query);
for (MongoIdentifiableEntity found : foundObjects) { for (MongoIdentifiableEntity found : foundObjects) {
context.addRemovedEntity(found);; context.addRemovedEntity(found);;

View file

@ -309,7 +309,7 @@ public class LDAPFederationProvider implements UserFederationProvider {
if (currentUser == null) { if (currentUser == null) {
// Add new user to Keycloak // Add new user to Keycloak
importUserFromPicketlink(realm, picketlinkUser); importUserFromPicketlink(realm, picketlinkUser);
logger.infof("Added new user from LDAP: " + username); logger.debugf("Added new user from LDAP: %s", username);
} else { } else {
if ((fedModel.getId().equals(currentUser.getFederationLink())) && (picketlinkUser.getId().equals(currentUser.getAttribute(LDAPFederationProvider.LDAP_ID)))) { if ((fedModel.getId().equals(currentUser.getFederationLink())) && (picketlinkUser.getId().equals(currentUser.getAttribute(LDAPFederationProvider.LDAP_ID)))) {
// Update keycloak user // Update keycloak user
@ -317,7 +317,7 @@ public class LDAPFederationProvider implements UserFederationProvider {
currentUser.setEmail(email); currentUser.setEmail(email);
currentUser.setFirstName(picketlinkUser.getFirstName()); currentUser.setFirstName(picketlinkUser.getFirstName());
currentUser.setLastName(picketlinkUser.getLastName()); currentUser.setLastName(picketlinkUser.getLastName());
logger.infof("Updated user from LDAP: " + currentUser.getUsername()); logger.debugf("Updated user from LDAP: %s", currentUser.getUsername());
} else { } else {
logger.warnf("User '%s' is not updated during sync as he is not linked to federation provider '%s'", username, fedModel.getDisplayName()); logger.warnf("User '%s' is not updated during sync as he is not linked to federation provider '%s'", username, fedModel.getDisplayName());
} }

View file

@ -20,7 +20,7 @@ public class CookieTokenStore {
private static final String DELIM = "@"; private static final String DELIM = "@";
public static void setTokenCookie(KeycloakDeployment deployment, HttpFacade facade, RefreshableKeycloakSecurityContext session) { public static void setTokenCookie(KeycloakDeployment deployment, HttpFacade facade, RefreshableKeycloakSecurityContext session) {
log.infof("Set new %s cookie now", AdapterConstants.KEYCLOAK_ADAPTER_STATE_COOKIE); log.debugf("Set new %s cookie now", AdapterConstants.KEYCLOAK_ADAPTER_STATE_COOKIE);
String accessToken = session.getTokenString(); String accessToken = session.getTokenString();
String idToken = session.getIdTokenString(); String idToken = session.getIdTokenString();
String refreshToken = session.getRefreshToken(); String refreshToken = session.getRefreshToken();

View file

@ -62,14 +62,14 @@ public class NodesRegistrationManagement {
} }
protected void sendRegistrationEvent(KeycloakDeployment deployment) { protected void sendRegistrationEvent(KeycloakDeployment deployment) {
log.info("Sending registration event right now"); log.debug("Sending registration event right now");
String host = HostUtils.getIpAddress(); String host = HostUtils.getIpAddress();
try { try {
ServerRequest.invokeRegisterNode(deployment, host); ServerRequest.invokeRegisterNode(deployment, host);
NodeRegistrationContext regContext = new NodeRegistrationContext(Time.currentTime(), deployment); NodeRegistrationContext regContext = new NodeRegistrationContext(Time.currentTime(), deployment);
nodeRegistrations.put(deployment.getRegisterNodeUrl(), regContext); nodeRegistrations.put(deployment.getRegisterNodeUrl(), regContext);
log.infof("Node '%s' successfully registered in Keycloak", host); log.debugf("Node '%s' successfully registered in Keycloak", host);
} catch (ServerRequest.HttpFailure failure) { } catch (ServerRequest.HttpFailure failure) {
log.error("failed to register node to keycloak"); log.error("failed to register node to keycloak");
log.error("status from server: " + failure.getStatus()); log.error("status from server: " + failure.getStatus());
@ -82,12 +82,12 @@ public class NodesRegistrationManagement {
} }
protected boolean sendUnregistrationEvent(KeycloakDeployment deployment) { protected boolean sendUnregistrationEvent(KeycloakDeployment deployment) {
log.info("Sending Unregistration event right now"); log.debug("Sending Unregistration event right now");
String host = HostUtils.getIpAddress(); String host = HostUtils.getIpAddress();
try { try {
ServerRequest.invokeUnregisterNode(deployment, host); ServerRequest.invokeUnregisterNode(deployment, host);
log.infof("Node '%s' successfully unregistered from Keycloak", host); log.debugf("Node '%s' successfully unregistered from Keycloak", host);
return true; return true;
} catch (ServerRequest.HttpFailure failure) { } catch (ServerRequest.HttpFailure failure) {
log.error("failed to unregister node from keycloak"); log.error("failed to unregister node from keycloak");

View file

@ -116,7 +116,7 @@ public class PreAuthActionsHandler {
if (action.getAdapterSessionIds() != null) { if (action.getAdapterSessionIds() != null) {
userSessionManagement.logoutHttpSessions(action.getAdapterSessionIds()); userSessionManagement.logoutHttpSessions(action.getAdapterSessionIds());
} else { } else {
log.infof("logout of all sessions for application '%s'", action.getResource()); log.debugf("logout of all sessions for application '%s'", action.getResource());
if (action.getNotBefore() > deployment.getNotBefore()) { if (action.getNotBefore() > deployment.getNotBefore()) {
deployment.setNotBefore(action.getNotBefore()); deployment.setNotBefore(action.getNotBefore());
} }

View file

@ -31,7 +31,7 @@ public class KeycloakLoginModule extends AbstractServerLoginModule {
public boolean login() throws LoginException { public boolean login() throws LoginException {
log.debug("KeycloakLoginModule.login()"); log.debug("KeycloakLoginModule.login()");
if (super.login() == true) { if (super.login() == true) {
log.info("super.login()==true"); log.debug("super.login()==true");
return true; return true;
} }

View file

@ -117,8 +117,8 @@ public class KeycloakAuthenticatorValve extends FormAuthenticator implements Lif
if (json == null) { if (json == null) {
return null; return null;
} }
log.info("**** using " + AdapterConstants.AUTH_DATA_PARAM_NAME); log.finest("**** using " + AdapterConstants.AUTH_DATA_PARAM_NAME);
log.info(json); log.finest(json);
return new ByteArrayInputStream(json.getBytes()); return new ByteArrayInputStream(json.getBytes());
} }
@ -127,7 +127,7 @@ public class KeycloakAuthenticatorValve extends FormAuthenticator implements Lif
if (is == null) { if (is == null) {
String path = context.getServletContext().getInitParameter("keycloak.config.file"); String path = context.getServletContext().getInitParameter("keycloak.config.file");
if (path == null) { if (path == null) {
log.info("**** using /WEB-INF/keycloak.json"); log.finest("**** using /WEB-INF/keycloak.json");
is = context.getServletContext().getResourceAsStream("/WEB-INF/keycloak.json"); is = context.getServletContext().getResourceAsStream("/WEB-INF/keycloak.json");
} else { } else {
try { try {

View file

@ -18,7 +18,7 @@ public class WildflyKeycloakServletExtension extends KeycloakServletExtension {
@Override @Override
protected ServletKeycloakAuthMech createAuthenticationMechanism(DeploymentInfo deploymentInfo, AdapterDeploymentContext deploymentContext, protected ServletKeycloakAuthMech createAuthenticationMechanism(DeploymentInfo deploymentInfo, AdapterDeploymentContext deploymentContext,
UndertowUserSessionManagement userSessionManagement, NodesRegistrationManagement nodesRegistrationManagement) { UndertowUserSessionManagement userSessionManagement, NodesRegistrationManagement nodesRegistrationManagement) {
log.info("creating WildflyAuthenticationMechanism"); log.debug("creating WildflyAuthenticationMechanism");
return new WildflyAuthenticationMechanism(deploymentContext, userSessionManagement, nodesRegistrationManagement, deploymentInfo.getConfidentialPortManager()); return new WildflyAuthenticationMechanism(deploymentContext, userSessionManagement, nodesRegistrationManagement, deploymentInfo.getConfidentialPortManager());
} }

View file

@ -48,7 +48,7 @@ public class MongoRoleEntity extends RoleEntity implements MongoIdentifiableEnti
List<MongoUserEntity> users = mongoStore.loadEntities(MongoUserEntity.class, query, invContext); List<MongoUserEntity> users = mongoStore.loadEntities(MongoUserEntity.class, query, invContext);
for (MongoUserEntity user : users) { for (MongoUserEntity user : users) {
logger.info("Removing role " + getName() + " from user " + user.getUsername()); //logger.info("Removing role " + getName() + " from user " + user.getUsername());
mongoStore.pullItemFromList(user, "roleIds", getId(), invContext); mongoStore.pullItemFromList(user, "roleIds", getId(), invContext);
} }
@ -59,7 +59,7 @@ public class MongoRoleEntity extends RoleEntity implements MongoIdentifiableEnti
users = mongoStore.loadEntities(MongoUserEntity.class, query, invContext); users = mongoStore.loadEntities(MongoUserEntity.class, query, invContext);
for (MongoUserEntity user : users) { for (MongoUserEntity user : users) {
logger.info("Removing scope " + getName() + " from user " + user.getUsername()); //logger.info("Removing scope " + getName() + " from user " + user.getUsername());
mongoStore.pullItemFromList(user, "scopeIds", getId(), invContext); mongoStore.pullItemFromList(user, "scopeIds", getId(), invContext);
} }

View file

@ -620,7 +620,7 @@ public class OpenIDConnectService {
String adapterSessionId = formData.getFirst(AdapterConstants.APPLICATION_SESSION_STATE); String adapterSessionId = formData.getFirst(AdapterConstants.APPLICATION_SESSION_STATE);
if (adapterSessionId != null) { if (adapterSessionId != null) {
String adapterSessionHost = formData.getFirst(AdapterConstants.APPLICATION_SESSION_HOST); String adapterSessionHost = formData.getFirst(AdapterConstants.APPLICATION_SESSION_HOST);
logger.infof("Adapter Session '%s' saved in ClientSession for client '%s'. Host is '%s'", adapterSessionId, client.getClientId(), adapterSessionHost); logger.debugf("Adapter Session '%s' saved in ClientSession for client '%s'. Host is '%s'", adapterSessionId, client.getClientId(), adapterSessionHost);
event.detail(AdapterConstants.APPLICATION_SESSION_STATE, adapterSessionId); event.detail(AdapterConstants.APPLICATION_SESSION_STATE, adapterSessionId);
clientSession.setNote(AdapterConstants.APPLICATION_SESSION_STATE, adapterSessionId); clientSession.setNote(AdapterConstants.APPLICATION_SESSION_STATE, adapterSessionId);

View file

@ -106,7 +106,7 @@ public class ResourceAdminManager {
} }
logger.debugv("logging out {0} resources ", clientSessions.size()); logger.debugv("logging out {0} resources ", clientSessions.size());
logger.infov("logging out resources: " + clientSessions); //logger.infov("logging out resources: {0}", clientSessions);
for (Map.Entry<ApplicationModel, List<ClientSessionModel>> entry : clientSessions.entrySet()) { for (Map.Entry<ApplicationModel, List<ClientSessionModel>> entry : clientSessions.entrySet()) {
logoutClientSessions(requestUri, realm, entry.getKey(), entry.getValue(), executor); logoutClientSessions(requestUri, realm, entry.getKey(), entry.getValue(), executor);
@ -251,7 +251,7 @@ public class ResourceAdminManager {
return new GlobalRequestResult(); return new GlobalRequestResult();
} }
logger.info("Send logoutApplication for URLs: " + mgmtUrls); if (logger.isDebugEnabled()) logger.debug("Send logoutApplication for URLs: " + mgmtUrls);
// Propagate this to all hosts // Propagate this to all hosts
GlobalRequestResult result = new GlobalRequestResult(); GlobalRequestResult result = new GlobalRequestResult();
@ -268,7 +268,7 @@ public class ResourceAdminManager {
protected boolean sendLogoutRequest(RealmModel realm, ApplicationModel resource, List<String> adapterSessionIds, ApacheHttpClient4Executor client, int notBefore, String managementUrl) { protected boolean sendLogoutRequest(RealmModel realm, ApplicationModel resource, List<String> adapterSessionIds, ApacheHttpClient4Executor client, int notBefore, String managementUrl) {
LogoutAction adminAction = new LogoutAction(TokenIdGenerator.generateId(), Time.currentTime() + 30, resource.getName(), adapterSessionIds, notBefore); LogoutAction adminAction = new LogoutAction(TokenIdGenerator.generateId(), Time.currentTime() + 30, resource.getName(), adapterSessionIds, notBefore);
String token = new TokenManager().encodeToken(realm, adminAction); String token = new TokenManager().encodeToken(realm, adminAction);
logger.infov("logout resource {0} url: {1} sessionIds: " + adapterSessionIds, resource.getName(), managementUrl); if (logger.isDebugEnabled()) logger.debugv("logout resource {0} url: {1} sessionIds: " + adapterSessionIds, resource.getName(), managementUrl);
ClientRequest request = client.createRequest(UriBuilder.fromUri(managementUrl).path(AdapterConstants.K_LOGOUT).build().toString()); ClientRequest request = client.createRequest(UriBuilder.fromUri(managementUrl).path(AdapterConstants.K_LOGOUT).build().toString());
ClientResponse response; ClientResponse response;
try { try {
@ -319,7 +319,7 @@ public class ResourceAdminManager {
return new GlobalRequestResult(); return new GlobalRequestResult();
} }
logger.info("Sending push revocation to URLS: " + mgmtUrls); if (logger.isDebugEnabled()) logger.info("Sending push revocation to URLS: " + mgmtUrls);
// Propagate this to all hosts // Propagate this to all hosts
GlobalRequestResult result = new GlobalRequestResult(); GlobalRequestResult result = new GlobalRequestResult();
@ -364,7 +364,7 @@ public class ResourceAdminManager {
ApacheHttpClient4Executor executor = createExecutor(); ApacheHttpClient4Executor executor = createExecutor();
try { try {
logger.info("Sending test nodes availability: " + mgmtUrls); if (logger.isDebugEnabled()) logger.debug("Sending test nodes availability: " + mgmtUrls);
// Propagate this to all hosts // Propagate this to all hosts
GlobalRequestResult result = new GlobalRequestResult(); GlobalRequestResult result = new GlobalRequestResult();
@ -384,7 +384,7 @@ public class ResourceAdminManager {
protected boolean sendTestNodeAvailabilityRequest(RealmModel realm, ApplicationModel application, ApacheHttpClient4Executor client, String managementUrl) { protected boolean sendTestNodeAvailabilityRequest(RealmModel realm, ApplicationModel application, ApacheHttpClient4Executor client, String managementUrl) {
TestAvailabilityAction adminAction = new TestAvailabilityAction(TokenIdGenerator.generateId(), Time.currentTime() + 30, application.getName()); TestAvailabilityAction adminAction = new TestAvailabilityAction(TokenIdGenerator.generateId(), Time.currentTime() + 30, application.getName());
String token = new TokenManager().encodeToken(realm, adminAction); String token = new TokenManager().encodeToken(realm, adminAction);
logger.infov("testNodes availability resource: {0} url: {1}", application.getName(), managementUrl); logger.debugv("testNodes availability resource: {0} url: {1}", application.getName(), managementUrl);
ClientRequest request = client.createRequest(UriBuilder.fromUri(managementUrl).path(AdapterConstants.K_TEST_AVAILABLE).build().toString()); ClientRequest request = client.createRequest(UriBuilder.fromUri(managementUrl).path(AdapterConstants.K_TEST_AVAILABLE).build().toString());
ClientResponse response; ClientResponse response;
try { try {

View file

@ -109,7 +109,7 @@ public class ClientsManagementService {
String nodeHost = getApplicationClusterHost(formData); String nodeHost = getApplicationClusterHost(formData);
event.client(application).detail(Details.NODE_HOST, nodeHost); event.client(application).detail(Details.NODE_HOST, nodeHost);
logger.infof("Registering cluster host '%s' for client '%s'", nodeHost, application.getName()); logger.debugf("Registering cluster host '%s' for client '%s'", nodeHost, application.getName());
application.registerNode(nodeHost, Time.currentTime()); application.registerNode(nodeHost, Time.currentTime());
@ -145,7 +145,7 @@ public class ClientsManagementService {
String nodeHost = getApplicationClusterHost(formData); String nodeHost = getApplicationClusterHost(formData);
event.client(application).detail(Details.NODE_HOST, nodeHost); event.client(application).detail(Details.NODE_HOST, nodeHost);
logger.infof("Unregistering cluster host '%s' for client '%s'", nodeHost, application.getName()); logger.debugf("Unregistering cluster host '%s' for client '%s'", nodeHost, application.getName());
application.unregisterNode(nodeHost); application.unregisterNode(nodeHost);

View file

@ -372,7 +372,7 @@ public class ApplicationResource {
if (node == null) { if (node == null) {
throw new BadRequestException("Node not found in params"); throw new BadRequestException("Node not found in params");
} }
logger.info("Register node: " + node); if (logger.isDebugEnabled()) logger.debug("Register node: " + node);
application.registerNode(node, Time.currentTime()); application.registerNode(node, Time.currentTime());
} }
@ -386,7 +386,7 @@ public class ApplicationResource {
@NoCache @NoCache
public void unregisterNode(final @PathParam("node") String node) { public void unregisterNode(final @PathParam("node") String node) {
auth.requireManage(); auth.requireManage();
logger.info("Unregister node: " + node); if (logger.isDebugEnabled()) logger.debug("Unregister node: " + node);
Integer time = application.getRegisteredNodes().get(node); Integer time = application.getRegisteredNodes().get(node);
if (time == null) { if (time == null) {
@ -406,7 +406,7 @@ public class ApplicationResource {
@NoCache @NoCache
public GlobalRequestResult testNodesAvailable() { public GlobalRequestResult testNodesAvailable() {
auth.requireManage(); auth.requireManage();
logger.info("Test availability of cluster nodes"); logger.debug("Test availability of cluster nodes");
return new ResourceAdminManager().testNodesAvailability(uriInfo.getRequestUri(), realm, application); return new ResourceAdminManager().testNodesAvailability(uriInfo.getRequestUri(), realm, application);
} }

View file

@ -132,7 +132,7 @@ public class RoleByIdResource extends RoleResource {
@Produces("application/json") @Produces("application/json")
public Set<RoleRepresentation> getRoleComposites(final @PathParam("role-id") String id) { public Set<RoleRepresentation> getRoleComposites(final @PathParam("role-id") String id) {
logger.info("*** getRoleComposites: '" + id + "'"); if (logger.isDebugEnabled()) logger.debug("*** getRoleComposites: '" + id + "'");
RoleModel role = getRoleModel(id); RoleModel role = getRoleModel(id);
auth.requireView(); auth.requireView();
return getRoleComposites(role); return getRoleComposites(role);