java.lang.Object
io.micronaut.http.server.netty.handler.accesslog.element.AccessLog

public class AccessLog extends Object
An Access log instance.
Since:
2.0
Author:
croudet
  • Method Details

    • reset

      public void reset()
      Resets the current values.
    • onRequestHeaders

      public void onRequestHeaders(ConnectionMetadata metadata, String method, io.netty.handler.codec.http.HttpHeaders headers, String uri, String protocol)
      Triggers LogElements for the ON_REQUEST_HEADERS event.
      Parameters:
      metadata - The connection metadata.
      method - The http method.
      headers - The request headers.
      uri - The uri.
      protocol - The protocol.
    • onRequestHeaders

      @Deprecated 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.