Class AccessLog
java.lang.Object
io.micronaut.http.server.netty.handler.accesslog.element.AccessLog
An Access log instance.
- Since:
- 2.0
- Author:
- croudet
-
Method Summary
Modifier and TypeMethodDescriptionvoid
log
(org.slf4j.Logger accessLogger) Logs at info level the accumulated values.void
onLastResponseWrite
(int bytesSent) Triggers LogElements for the ON_LAST_RESPONSE_WRITE event.void
onRequestHeaders
(io.netty.channel.socket.SocketChannel channel, String method, io.netty.handler.codec.http.HttpHeaders headers, String uri, String protocol) Triggers LogElements for the ON_REQUEST_HEADERS event.void
onResponseHeaders
(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpHeaders headers, String status) Triggers LogElements for the ON_RESPONSE_HEADERS event.void
onResponseWrite
(int bytesSent) Triggers LogElements for the ON_RESPONSE_WRITE event.void
reset()
Resets the current values.
-
Method Details
-
reset
public void reset()Resets the current values. -
onRequestHeaders
public void onRequestHeaders(io.netty.channel.socket.SocketChannel channel, String method, io.netty.handler.codec.http.HttpHeaders headers, String uri, String protocol) Triggers LogElements for the ON_REQUEST_HEADERS event.- Parameters:
channel
- The socket channel.method
- The http method.headers
- The request headers.uri
- The uri.protocol
- The protocol.
-
onResponseHeaders
public void onResponseHeaders(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpHeaders headers, String status) Triggers LogElements for the ON_RESPONSE_HEADERS event.- Parameters:
ctx
- The ChannelHandlerContext.headers
- The response headers.status
- The response status.
-
onResponseWrite
public void onResponseWrite(int bytesSent) Triggers LogElements for the ON_RESPONSE_WRITE event.- Parameters:
bytesSent
- The number of bytes sent.
-
onLastResponseWrite
public void onLastResponseWrite(int bytesSent) Triggers LogElements for the ON_LAST_RESPONSE_WRITE event.- Parameters:
bytesSent
- The number of bytes sent.
-
log
public void log(org.slf4j.Logger accessLogger) Logs at info level the accumulated values.- Parameters:
accessLogger
- A logger.
-