Package io.imagekit.core.http
Class LoggingHttpClient.Builder
-
- All Implemented Interfaces:
public final class LoggingHttpClient.BuilderA builder for LoggingHttpClient.
-
-
Method Summary
Modifier and Type Method Description final LoggingHttpClient.BuilderhttpClient(HttpClient httpClient)The underlying HttpClient for making requests. final LoggingHttpClient.BuilderredactedHeaders(Set<String> redactedHeaders)Sensitive headers to redact from logs. final LoggingHttpClient.Builderclock(Clock clock)The clock to use for measuring request and response durations. final LoggingHttpClient.Builderlevel(LogLevel level)The log level to use. final LoggingHttpClientbuild()Returns an immutable instance of LoggingHttpClient. -
-
Method Detail
-
httpClient
final LoggingHttpClient.Builder httpClient(HttpClient httpClient)
The underlying HttpClient for making requests.
-
redactedHeaders
final LoggingHttpClient.Builder redactedHeaders(Set<String> redactedHeaders)
Sensitive headers to redact from logs.
Defaults to
Set.of("authorization", "api-key", "x-api-key", "cookie", "set-cookie").
-
clock
final LoggingHttpClient.Builder clock(Clock clock)
The clock to use for measuring request and response durations.
This is primarily useful for using a fake clock in tests.
Defaults to Clock.systemUTC.
-
level
final LoggingHttpClient.Builder level(LogLevel level)
The log level to use.
Pass LogLevel.fromEnv to read from environment variables.
-
build
final LoggingHttpClient build()
Returns an immutable instance of LoggingHttpClient.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.httpClient() .level()
-
-
-
-