Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
up
  • Loading branch information
Liudmila Molkova committed Jan 6, 2025
commit 9588c6d39793bc2d4ef6901ca0406f455958c843
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,15 @@ private void logRequest(ClientLogger logger, HttpRequest request, long startNano
addHeadersToLogMessage(request.getHeaders(), logBuilder);

if (httpLogDetailLevel.shouldLogBody() && canLogBody(request.getBody())) {
String content;
try {
BinaryData bufferedBody = request.getBody().toReplayableBinaryData();
request.setBody(bufferedBody);
content = bufferedBody.toString();
logBuilder.addKeyValue(LoggingKeys.BODY_KEY, bufferedBody.toString());
} catch (RuntimeException e) {
// we'll log exception at the appropriate level.
throw logException(logger, request, null, e, startNanoTime, null, requestContentLength, redactedUrl,
tryCount);
}

logBuilder.addKeyValue(LoggingKeys.BODY_KEY, content);
}

logBuilder.log();
Expand Down