Interface AccessLogArgProvider
public interface AccessLogArgProvider
A provider of the args required for access log.
- Since:
- 1.0.1
- Author:
- limaoning
-
Method Summary
Modifier and TypeMethodDescription@Nullable ZonedDateTime
Returns the date-time of the moment when the request was received.@Nullable ConnectionInformation
Returns the information about the current connection.long
Returns the response content length.@Nullable Map<CharSequence,
Set<Cookie>> cookies()
Returns resolved HTTP cookies.long
duration()
Returns the request/response duration.@Nullable CharSequence
method()
Returns the name of this method, (e.g.@Nullable String
protocol()
Returns the protocol version, (e.g.@Nullable SocketAddress
Deprecated.as of 1.0.26.@Nullable CharSequence
requestHeader
(CharSequence name) Returns the value of a request header with the specified name ornull
is case such request header does not exist.default @Nullable Iterator<Map.Entry<CharSequence,
CharSequence>> Returns an iterator over all request headers.@Nullable CharSequence
responseHeader
(CharSequence name) Returns the value of a response header with the specified name ornull
is case such response header does not exist.default @Nullable Iterator<Map.Entry<CharSequence,
CharSequence>> Returns an iterator over all response headers.@Nullable CharSequence
status()
Returns the response status, (e.g.@Nullable CharSequence
uri()
Returns the requested URI, (e.g.@Nullable String
user()
Returns the user identifier.@Nullable String
Deprecated.as of 1.0.6.
-
Method Details
-
zonedDateTime
Deprecated.as of 1.0.6. Prefer usingaccessDateTime()
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.as of 1.0.26. UseConnectionInformation.connectionRemoteAddress()
Returns the address of the remote peer ornull
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
Returns the value of a request header with the specified name ornull
is case such request header does not exist.- Parameters:
name
- the request header name- Returns:
- the value of the request header
-
responseHeader
Returns the value of a response header with the specified name ornull
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
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
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
-