diff --git a/msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java b/msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java index 20d5f07e..1d8d1a43 100644 --- a/msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java +++ b/msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java @@ -95,10 +95,17 @@ public IAuthenticationResult get() { msalRequest.requestContext().correlationId(), error); - clientApplication.log.warn( - LogHelper.createMessage( - String.format("Execution of %s failed: %s", this.getClass(), ex.getMessage()), - msalRequest.headers().getHeaderCorrelationIdValue())); + String logMessage = LogHelper.createMessage( + String.format("Execution of %s failed: %s", this.getClass(), ex.getMessage()), + msalRequest.headers().getHeaderCorrelationIdValue()); + if (ex instanceof MsalClientException) { + MsalClientException exception = (MsalClientException) ex; + if (exception.errorCode() != null && exception.errorCode().equalsIgnoreCase(AuthenticationErrorCode.CACHE_MISS)) { + clientApplication.log.debug(logMessage); + } + } else { + clientApplication.log.warn(logMessage); + } throw new CompletionException(ex); }