HttpRequestLogger Interface

public interface HttpRequestLogger

Manages logging HTTP requests in HttpLoggingPolicy.

Method Summary

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

Gets the LogLevel used to log the HTTP request.

abstract Mono<Void> logRequest(ClientLogger logger, HttpRequestLoggingContext loggingOptions)

Logs the HTTP request.

default void logRequestSync(ClientLogger logger, HttpRequestLoggingContext loggingOptions)

Logs the HTTP request.

Method Details

getLogLevel

public default LogLevel getLogLevel(HttpRequestLoggingContext loggingOptions)

Gets the LogLevel used to log the HTTP request.

By default, this will return INFORMATIONAL.

Parameters:

loggingOptions - The information available during request logging.

Returns:

The LogLevel used to log the HTTP request.

logRequest

public abstract Mono logRequest(ClientLogger logger, HttpRequestLoggingContext loggingOptions)

Logs the HTTP request.

To get the LogLevel used to log the HTTP request use getLogLevel(HttpRequestLoggingContext loggingOptions).

Parameters:

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

Returns:

A reactive response that indicates that the HTTP request has been logged.

logRequestSync

public default void logRequestSync(ClientLogger logger, HttpRequestLoggingContext loggingOptions)

Logs the HTTP request. To get the LogLevel used to log the HTTP request use getLogLevel(HttpRequestLoggingContext loggingOptions).

Parameters:

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

Applies to