From bb7c32faaec8fba17fd682a927a7d5348d001781 Mon Sep 17 00:00:00 2001 From: Mauro Mugnaini Date: Fri, 3 Jul 2020 17:32:48 +0200 Subject: [PATCH] Rationalized logs --- .../org/gcube/portal/oidc/lr62/OIDCUmaUtil.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/gcube/portal/oidc/lr62/OIDCUmaUtil.java b/src/main/java/org/gcube/portal/oidc/lr62/OIDCUmaUtil.java index 0c2a462..b83d20b 100644 --- a/src/main/java/org/gcube/portal/oidc/lr62/OIDCUmaUtil.java +++ b/src/main/java/org/gcube/portal/oidc/lr62/OIDCUmaUtil.java @@ -27,9 +27,7 @@ public class OIDCUmaUtil { String infraContext) { try { - if (log.isDebugEnabled()) { - log.debug("Getting client token from server"); - } + log.debug("Getting client token from server"); JWTToken clientToken = OpenIdConnectRESTHelper.queryClientToken(clientId, clientSecret, tokenURL); provideClientUMATokenInThreadLocal(clientToken.getAsBearer(), tokenURL, infraContext); } catch (Exception e) { @@ -48,19 +46,13 @@ public class OIDCUmaUtil { log.error("Cannot URL encode context", e); return; } - if (log.isDebugEnabled()) { - log.debug("URL encoded context is: " + encodedContext); - } + log.debug("URL encoded context is: {}", encodedContext); try { - if (log.isDebugEnabled()) { - log.debug("Getting UMA token from server"); - } + log.debug("Getting UMA token from server"); JWTToken umaToken = OpenIdConnectRESTHelper.queryUMAToken(tokenURL, clientAuthorizationBearer, encodedContext, null); - if (log.isDebugEnabled()) { - log.debug("Setting token in the UMA JWT provider"); - } + log.debug("Setting token in the UMA JWT provider"); UmaJWTProvider.instance.set(JWTTokenUtil.getRawContent(umaToken)); } catch (Exception e) { log.error("Cannot retrieve client UMA token", e);