From 55ef4030903d921db1afed5aed1025b9fa817f4c Mon Sep 17 00:00:00 2001
From: Martin <git@mail.de>
Date: Tue, 11 Mar 2025 20:49:41 +0100
Subject: [PATCH] adjust logging

---
 .../keycloak/client/KeycloakClientRemoteService.java     | 8 ++++----
 .../keycloak/realm/KeycloakRealmRemoteService.java       | 9 ++++++---
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/ozgcloud-keycloak-operator/src/main/java/de/ozgcloud/operator/keycloak/client/KeycloakClientRemoteService.java b/ozgcloud-keycloak-operator/src/main/java/de/ozgcloud/operator/keycloak/client/KeycloakClientRemoteService.java
index 7f9b874..e8b35d2 100644
--- a/ozgcloud-keycloak-operator/src/main/java/de/ozgcloud/operator/keycloak/client/KeycloakClientRemoteService.java
+++ b/ozgcloud-keycloak-operator/src/main/java/de/ozgcloud/operator/keycloak/client/KeycloakClientRemoteService.java
@@ -47,12 +47,12 @@ class KeycloakClientRemoteService {
 
 	public void updateClient(ClientRepresentation client, String realm) {
 		try {
-			System.out.println("UPDATE CLIENT...");
-			System.out.println("Realm: " + realm);
-			System.out.println("Client: " + new ObjectMapper().writeValueAsString(client));
+			LOG.debug("UPDATE CLIENT...");
+			LOG.debug("Realm: {}", realm);
+			LOG.debug("Client: {}", new ObjectMapper().writeValueAsString(client));
 
 		} catch (JsonProcessingException e) {
-			System.out.println("Error parsing :(");
+			LOG.debug("UPDATE CLIENT ERROR parsing :(");
 		}
 		getClientResource(realm, client.getId()).update(client);
 	}
diff --git a/ozgcloud-keycloak-operator/src/main/java/de/ozgcloud/operator/keycloak/realm/KeycloakRealmRemoteService.java b/ozgcloud-keycloak-operator/src/main/java/de/ozgcloud/operator/keycloak/realm/KeycloakRealmRemoteService.java
index 50669d9..032348f 100644
--- a/ozgcloud-keycloak-operator/src/main/java/de/ozgcloud/operator/keycloak/realm/KeycloakRealmRemoteService.java
+++ b/ozgcloud-keycloak-operator/src/main/java/de/ozgcloud/operator/keycloak/realm/KeycloakRealmRemoteService.java
@@ -37,7 +37,9 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 
 import de.ozgcloud.operator.keycloak.KeycloakException;
 import lombok.RequiredArgsConstructor;
+import lombok.extern.log4j.Log4j2;
 
+@Log4j2
 @RequiredArgsConstructor
 @Component
 class KeycloakRealmRemoteService {
@@ -54,10 +56,11 @@ class KeycloakRealmRemoteService {
 
 	public void updateRealm(RealmRepresentation realm) {
 		try {
-			System.out.println("UPDATE REALM...");
-			System.out.println("Realm: " + new ObjectMapper().writeValueAsString(realm));
+			LOG.debug("UPDATE REALM...");
+			LOG.debug("Realm: {}", new ObjectMapper().writeValueAsString(realm));
+
 		} catch (JsonProcessingException e) {
-			System.out.println("Error parsing :(");
+			LOG.debug("UPDATE REALM ERROR parsing :(");
 		}
 		keycloak.realm(realm.getRealm()).update(realm);
 	}
-- 
GitLab