Skip to content

Commit

Permalink
Reduce logging level of CACHE_MISS <GitHub Issue #833>
Browse files Browse the repository at this point in the history
Addresses GitHub Issue #833 by reducing the logging level of a
CACHE_MISS in the AuthenticationResultSupplier to debug level.
  • Loading branch information
papaya2k committed Jul 23, 2024
1 parent c83185c commit 361ec5f
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 361ec5f

Please sign in to comment.