HttpResponseLogger Interface

public interface HttpResponseLogger

Manages logging HTTP responses in HttpLoggingPolicy.

Method Summary

Modifier and Type Method and Description
default LogLevel getLogLevel(HttpResponseLoggingContext loggingOptions)

Gets the LogLevel used to log the HTTP response.

abstract Mono<HttpResponse> logResponse(ClientLogger logger, HttpResponseLoggingContext loggingOptions)

Logs the HTTP response.

default HttpResponse logResponseSync(ClientLogger logger, HttpResponseLoggingContext loggingOptions)

Logs the HTTP response.

Method Details

getLogLevel

public default LogLevel getLogLevel(HttpResponseLoggingContext loggingOptions)

Gets the LogLevel used to log the HTTP response.

By default, this will return INFORMATIONAL.

Parameters:

loggingOptions - The information available during response logging.

Returns:

The LogLevel used to log the HTTP response.

logResponse

public abstract Mono logResponse(ClientLogger logger, HttpResponseLoggingContext loggingOptions)

Logs the HTTP response.

To get the LogLevel used to log the HTTP response use getLogLevel(HttpResponseLoggingContext loggingOptions).

Parameters:

logger - The ClientLogger used to log the response.
loggingOptions - The information available during response logging.

Returns:

A reactive response that returns the HTTP response that was logged.

logResponseSync

public default HttpResponse logResponseSync(ClientLogger logger, HttpResponseLoggingContext loggingOptions)

Logs the HTTP response. To get the LogLevel used to log the HTTP response use getLogLevel(HttpResponseLoggingContext loggingOptions) .

Parameters:

logger - The ClientLogger used to log the response.
loggingOptions - The information available during response logging.

Returns:

A response that returns the HTTP response that was logged.

Applies to