MCPcopy Index your code
hub / github.com/OpenFeign/feign / logRequest

Method logRequest

core/src/main/java/feign/Logger.java:68–93  ·  view source on GitHub ↗
(String configKey, Level logLevel, Request request)

Source from the content-addressed store, hash-verified

66 }
67
68 protected void logRequest(String configKey, Level logLevel, Request request) {
69 String protocolVersion = resolveProtocolVersion(request.protocolVersion());
70 log(configKey, "---> %s %s %s", request.httpMethod().name(), request.url(), protocolVersion);
71 if (logLevel.ordinal() >= Level.HEADERS.ordinal()) {
72
73 for (String field : request.headers().keySet()) {
74 if (shouldLogRequestHeader(field)) {
75 for (String value : valuesOrEmpty(request.headers(), field)) {
76 log(configKey, "%s: %s", field, value);
77 }
78 }
79 }
80
81 int bodyLength = 0;
82 if (request.body() != null) {
83 bodyLength = request.length();
84 if (logLevel.ordinal() >= Level.FULL.ordinal()) {
85 String bodyText =
86 request.charset() != null ? new String(request.body(), request.charset()) : null;
87 log(configKey, ""); // CRLF
88 log(configKey, "%s", bodyText != null ? bodyText : "Binary data");
89 }
90 }
91 log(configKey, "---> END HTTP (%s-byte body)", bodyLength);
92 }
93 }
94
95 protected void logRetry(String configKey, Level logLevel) {
96 log(configKey, "---> RETRYING");

Callers 3

logRequestMethod · 0.45
executeAndDecodeMethod · 0.45
executeAndDecodeMethod · 0.45

Calls 12

logMethod · 0.95
httpMethodMethod · 0.80
valuesOrEmptyMethod · 0.80
nameMethod · 0.65
urlMethod · 0.65
headersMethod · 0.65
bodyMethod · 0.65
lengthMethod · 0.65
protocolVersionMethod · 0.45
charsetMethod · 0.45

Tested by

no test coverage detected