From 1033e04b33b23e1dcd4ad7a7c7699ac9d882867c Mon Sep 17 00:00:00 2001 From: minwoox Date: Wed, 18 Dec 2024 17:13:33 +0900 Subject: [PATCH] Update --- .../armeria/common/logging/DefaultLogWriter.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/com/linecorp/armeria/common/logging/DefaultLogWriter.java b/core/src/main/java/com/linecorp/armeria/common/logging/DefaultLogWriter.java index 0b86fba68e3..d9006080834 100644 --- a/core/src/main/java/com/linecorp/armeria/common/logging/DefaultLogWriter.java +++ b/core/src/main/java/com/linecorp/armeria/common/logging/DefaultLogWriter.java @@ -114,11 +114,7 @@ public void logResponse(RequestLog log) { responseLogLevel.log(logger, logFormatter.formatRequest(log)); } - if (responseCause == null) { - responseLogLevel.log(logger, responseStr); - return; - } - if (responseCauseFilter.test(ctx, responseCause)) { + if (responseCause == null || responseCauseFilter.test(ctx, responseCause)) { responseLogLevel.log(logger, responseStr); } else { responseLogLevel.log(logger, responseStr, responseCause); @@ -135,8 +131,9 @@ static boolean isSuccess(RequestLog log) { } else if (ctx instanceof ServiceRequestContext) { successFunction = ((ServiceRequestContext) ctx).config().successFunction(); } else { - throw new IllegalStateException( - ctx + " is neither ClientRequestContext nor ServiceRequestContext"); + throw new IllegalArgumentException( + ctx + " is neither " + ClientRequestContext.class.getSimpleName() + " nor " + + ServiceRequestContext.class.getSimpleName()); } return successFunction.isSuccess(ctx, log); }