Interface LogElement
- All Known Implementing Classes:
ConstantElement
public interface LogElement
Represents a http request or response element.
- Since:
- 2.0
- Author:
- croudet
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Copy this log element when it is not stateless.events()
The sets of events that this log element must process.default String
onLastResponseWrite
(int bytesSent) Responds to an ON_LAST_RESPONSE_WRITE event.default String
onRequestHeaders
(io.netty.channel.socket.SocketChannel channel, String method, io.netty.handler.codec.http.HttpHeaders headers, String uri, String protocol) Responds to an ON_REQUEST_HEADERS event.default String
onResponseHeaders
(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpHeaders headers, String status) Responds to an ON_RESPONSE_HEADERS event.default void
onResponseWrite
(int bytesSent) Responds to an ON_RESPONSE_WRITE event.default void
reset()
Reset the computed value.
-
Method Details
-
events
Set<LogElement.Event> events()The sets of events that this log element must process. Empty for ConstantElement.- Returns:
- A list of events.
-
reset
default void reset()Reset the computed value. -
onRequestHeaders
default String onRequestHeaders(io.netty.channel.socket.SocketChannel channel, String method, io.netty.handler.codec.http.HttpHeaders headers, String uri, String protocol) Responds to an ON_REQUEST_HEADERS event. Also used for ConstantElement with all parameters as null.- Parameters:
channel
- The socket channel.method
- The http method.headers
- The request headers.uri
- The request uri.protocol
- The request protocol.- Returns:
- The processed value.
-
onResponseHeaders
default String onResponseHeaders(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpHeaders headers, String status) Responds to an ON_RESPONSE_HEADERS event.- Parameters:
ctx
- The ChannelHandlerContext.headers
- The response headers.status
- The response status.- Returns:
- The processed value.
-
onResponseWrite
default void onResponseWrite(int bytesSent) Responds to an ON_RESPONSE_WRITE event.- Parameters:
bytesSent
- The number of bytes sent.
-
onLastResponseWrite
Responds to an ON_LAST_RESPONSE_WRITE event.- Parameters:
bytesSent
- The number of bytes sent.- Returns:
- The processed value.
-
copy
LogElement copy()Copy this log element when it is not stateless.- Returns:
- A copy of this log element.
-