Skip to content

Commit

Permalink
Merge branch 'master' into refactor-discovery-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Aias00 authored Feb 13, 2025
2 parents 6e5bf92 + 5bd78ff commit 3fd26a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ public Flux<DataBuffer> getBody() {
}
}).doFinally(signal -> {
int size = writer.size();
String body = writer.output();
boolean requestBodyTooLarge = LogCollectConfigUtils.isRequestBodyTooLarge(size);
if (size == 0 || requestBodyTooLarge) {
return;
}
String body = writer.output();
logInfo.setRequestBody(body);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ private void logResponse(final ShenyuContext shenyuContext, final BodyWriter wri
}
if (Objects.nonNull(writer)) {
int size = writer.size();
String body = writer.output();
if (size > 0 && !LogCollectConfigUtils.isResponseBodyTooLarge(size)) {
String body = writer.output();
logInfo.setResponseBody(body);
}
} else {
Expand Down Expand Up @@ -261,8 +261,8 @@ public void logError(final Throwable throwable) {
}

int size = bytes.length;
String body = new String(bytes, StandardCharsets.UTF_8);
if (size > 0 && !LogCollectConfigUtils.isResponseBodyTooLarge(size)) {
String body = new String(bytes, StandardCharsets.UTF_8);
logInfo.setResponseBody(body);
}
// collect log
Expand Down

0 comments on commit 3fd26a8

Please sign in to comment.