Skip to content

Commit

Permalink
Merge pull request #844 from papaya2k/cache-miss-logging-fix
Browse files Browse the repository at this point in the history
Reduce logging level of CACHE_MISS <GitHub Issue #833>
  • Loading branch information
Avery-Dunn committed Jul 25, 2024
2 parents 9374a3a + 361ec5f commit 006abce
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 006abce

Please sign in to comment.