Skip to content
Snippets Groups Projects
Commit 3e45d8d3 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-4453 adjust logging format

parent bec64a37
No related branches found
No related tags found
No related merge requests found
......@@ -61,8 +61,7 @@ public class KeycloakClientReconciler implements Reconciler<OzgCloudKeycloakClie
return buildStatusOk(resource);
} catch (Exception e) {
LOG.error("Could not reconcile client {} in namespace {}: {}", resource.getMetadata().getName(), resource.getMetadata().getNamespace(),
e.getStackTrace());
LOG.error("Could not reconcile client " + resource.getMetadata().getName() + " in namespace " + resource.getMetadata().getNamespace(), e);
resource.setStatus(OzgCloudKeycloakClientStatus.builder().status(OzgCloudCustomResourceStatus.ERROR).message(e.getMessage()).build());
return UpdateControl.updateStatus(resource).rescheduleAfter(Config.RECONCILER_RETRY_SECONDS);
}
......
......@@ -60,8 +60,7 @@ public class KeycloakGroupReconciler implements Reconciler<OzgCloudKeycloakGroup
return buildStatusOk(resource);
} catch (Exception e) {
LOG.warn("Could not reconcile group {} in namespace {}: {}", resource.getMetadata().getName(), resource.getMetadata().getNamespace(),
e.getStackTrace());
LOG.warn("Could not reconcile group " + resource.getMetadata().getName() + " in namespace " + resource.getMetadata().getNamespace(), e);
resource.setStatus(OzgCloudKeycloakGroupStatus.builder().status(OzgCloudCustomResourceStatus.ERROR).message(e.getMessage()).build());
return UpdateControl.updateStatus(resource).rescheduleAfter(Config.RECONCILER_RETRY_SECONDS);
}
......
......@@ -58,8 +58,7 @@ public class KeycloakRealmReconciler implements Reconciler<OzgCloudKeycloakRealm
return UpdateControl.updateStatus(resource);
} catch (Exception e) {
LOG.warn("Could not reconcile realm {} in namespace {}: {}", resource.getMetadata().getName(), resource.getMetadata().getNamespace(),
e.getStackTrace());
LOG.warn("Could not reconcile realm " + resource.getMetadata().getName() + " in namespace " + resource.getMetadata().getNamespace(), e);
resource.setStatus(OzgCloudKeycloakRealmStatus.builder().status(OzgCloudCustomResourceStatus.ERROR).message(e.getMessage()).build());
return UpdateControl.updateStatus(resource).rescheduleAfter(Config.RECONCILER_RETRY_SECONDS);
}
......@@ -81,7 +80,7 @@ public class KeycloakRealmReconciler implements Reconciler<OzgCloudKeycloakRealm
service.deleteRealm(realmName);
return DeleteControl.defaultDelete();
} catch (Exception e) {
LOG.warn("Could not delete KeycloakRealm {}: {}.", realmName, e.getStackTrace());
LOG.warn("Could not delete KeycloakRealm " + realmName, e);
return DeleteControl.defaultDelete();
}
}
......
......@@ -76,7 +76,7 @@ public class KeycloakUserReconciler implements Reconciler<OzgCloudKeycloakUser>,
} catch (Exception e) {
var errorMessage = e.getMessage();
LOG.warn("Could not reconcile user {} for namespace {}: {}. {}", userName, namespace, errorMessage, e.getStackTrace());
LOG.warn("Could not reconcile user " + userName + " for namespace " + namespace, e);
return UserUpdateControlBuilder.fromResource(resource)
.withStatus(OzgCloudCustomResourceStatus.ERROR)
......@@ -103,10 +103,10 @@ public class KeycloakUserReconciler implements Reconciler<OzgCloudKeycloakUser>,
service.deleteUser(user.getSpec(), namespace);
return DeleteControl.defaultDelete();
} catch (NotFoundException e) {
LOG.info("Could not delete user {} in namespace {}, user not found.", userName, namespace);
LOG.info("Could not delete user " + userName + " in namespace " + namespace + " user not found.", e);
return DeleteControl.defaultDelete();
} catch (Exception e) {
LOG.warn("Could not delete user {} in namespace {}.", userName, namespace);
LOG.warn("Could not delete user " + userName + " in namespace " + namespace, e);
return DeleteControl.defaultDelete();
}
}
......
......@@ -43,7 +43,7 @@ class UserSecretReader {
try {
return new String(Base64.decode(encodedPassword));
} catch (IOException e) {
throw new RuntimeException("Could not decode content from secret (base64) for secret " + secret.getFullResourceName());
throw new RuntimeException("Could not decode content from secret (base64) for secret " + secret.getFullResourceName(), e);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment