Interface AccessLogArgProvider


public interface AccessLogArgProvider
A provider of the args required for access log.
Since:
1.0.1
Author:
limaoning
  • Method Details

    • zonedDateTime

      @Deprecated @Nullable String zonedDateTime()
      Deprecated.
      as of 1.0.6. Prefer using accessDateTime() This method will be removed in version 1.2.0.
      Returns the date-time string with a time-zone, (e.g. "30/Oct/2020:03:52:11 +0000").
      Returns:
      the date-time string with a time-zone
    • accessDateTime

      @Nullable ZonedDateTime accessDateTime()
      Returns the date-time of the moment when the request was received.
      Returns:
      zoned date-time
      Since:
      1.0.6
    • remoteAddress

      @Deprecated @Nullable SocketAddress remoteAddress()
      Returns the address of the remote peer or null in case of Unix Domain Sockets.
      Returns:
      the peer's address
    • connectionInformation

      @Nullable ConnectionInformation connectionInformation()
      Returns the information about the current connection.

      Note that the ConnectionInformation.remoteAddress() will return the forwarded remote client address if the server is configured in forwarded mode.

      Returns:
      the connection info
      Since:
      1.0.26
      See Also:
    • method

      @Nullable CharSequence method()
      Returns the name of this method, (e.g. "GET").
      Returns:
      the name of this method
    • uri

      @Nullable CharSequence uri()
      Returns the requested URI, (e.g. "/hello").
      Returns:
      the requested URI
    • protocol

      @Nullable String protocol()
      Returns the protocol version, (e.g. "HTTP/1.1" or "HTTP/2.0").
      Returns:
      the protocol version
    • user

      @Nullable String user()
      Returns the user identifier.
      Returns:
      the user identifier
    • status

      @Nullable CharSequence status()
      Returns the response status, (e.g. 200).
      Returns:
      the response status
    • contentLength

      long contentLength()
      Returns the response content length.
      Returns:
      the response content length
    • duration

      long duration()
      Returns the request/response duration.
      Returns:
      the request/response duration in milliseconds
    • requestHeader

      @Nullable CharSequence requestHeader(CharSequence name)
      Returns the value of a request header with the specified name or null is case such request header does not exist.
      Parameters:
      name - the request header name
      Returns:
      the value of the request header
    • responseHeader

      @Nullable CharSequence responseHeader(CharSequence name)
      Returns the value of a response header with the specified name or null is case such response header does not exist.
      Parameters:
      name - the response header name
      Returns:
      the value of the response header
      Since:
      1.0.4
    • cookies

      @Nullable Map<CharSequence,Set<Cookie>> cookies()
      Returns resolved HTTP cookies.

      Warning: Be cautious with cookies information and what kind of sensitive data is written to the logs. By default, no cookies information is written to the access log.

      Returns:
      Resolved HTTP cookies
      Since:
      1.0.6
    • requestHeaderIterator

      default @Nullable Iterator<Map.Entry<CharSequence,CharSequence>> requestHeaderIterator()
      Returns an iterator over all request headers.
      Returns:
      an iterator over all request headers or null if request is not available
      Since:
      1.2.6
    • responseHeaderIterator

      default @Nullable Iterator<Map.Entry<CharSequence,CharSequence>> responseHeaderIterator()
      Returns an iterator over all response headers.
      Returns:
      an iterator over all response headers or null if response is not available
      Since:
      1.2.6