Top Description Methods
reactor.netty.http.server.logging

public Interface AccessLogFactory

extends Function<AccessLogArgProvider, AccessLog>
Imports
java.util.function.Function, .Predicate

An interface to declare more concisely a Function that apply an AccessLog by an AccessLogArgProvider.

Can be used in accessLog method for example.

Authors
Simon Baslé, Audrey Neveu
Since
1.0.3

Method Summary

Modifier and TypeMethod and Description
public static AccessLogFactory
createFilter(Predicate<AccessLogArgProvider>
the filter that returns true if the request should be logged, false otherwise
predicate
)

Helper method to create an access log factory that selectively enables access logs.

public static AccessLogFactory
createFilter(Predicate<AccessLogArgProvider>
the filter that returns true if the request should be logged, false otherwise
predicate
,
AccessLogFactory
the AccessLogFactory that creates AccessLog instances, encapsulating the format and the extraction of relevant arguments
formatFunction
)

Helper method to create an access log factory that selectively enables access logs and customizes the format to apply.

Inherited from java.util.function.Function:
andThenapplycomposeidentity

Method Detail

createFilterback to summary
public static AccessLogFactory createFilter(Predicate<AccessLogArgProvider> predicate)

Helper method to create an access log factory that selectively enables access logs.

Any request (represented as an AccessLogArgProvider) that doesn't match the provided Predicate is excluded from the access log. Other requests are logged using the default format.

Parameters
predicate:Predicate<AccessLogArgProvider>

the filter that returns true if the request should be logged, false otherwise

Returns:AccessLogFactory

an AccessLogFactory to be used in reactor.netty.http.server.HttpServer#accessLog(boolean, AccessLogFactory)

Since
1.0.3
createFilterback to summary
public static AccessLogFactory createFilter(Predicate<AccessLogArgProvider> predicate, AccessLogFactory formatFunction)

Helper method to create an access log factory that selectively enables access logs and customizes the format to apply.

Any request (represented as an AccessLogArgProvider) that doesn't match the provided Predicate is excluded from the access log. Other requests are logged using the provided formatting Function. Said function is expected to create an AccessLog instance, defining both the String format and a vararg of the relevant arguments, extracted from the AccessLogArgProvider.

Parameters
predicate:Predicate<AccessLogArgProvider>

the filter that returns true if the request should be logged, false otherwise

formatFunction:AccessLogFactory

the AccessLogFactory that creates AccessLog instances, encapsulating the format and the extraction of relevant arguments

Returns:AccessLogFactory

an AccessLogFactory to be used in reactor.netty.http.server.HttpServer#accessLog(boolean, AccessLogFactory)

Since
1.0.3