Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods
Modifier and Type
Method
Description
static RequestLogBuilder
builder (RequestContext ctx)
Object
rawResponseContent ()
Throwable
responseCause ()
Returns the cause of response processing failure.
Object
responseContent ()
String
responseContentPreview ()
Returns the preview of response content of the
Response
.
default long
responseDurationNanos ()
Returns the duration that was taken to consume or produce the response completely, in nanoseconds.
long
responseEndTimeNanos ()
Returns the time when the processing of the response finished, in nanoseconds.
Long
responseFirstBytesTransferredTimeNanos ()
Returns the time when the first bytes of the response headers were transferred over the wire.
ResponseHeaders
responseHeaders ()
long
responseLength ()
Returns the length of the response content.
long
responseStartTimeMicros ()
Returns the time when the processing of the response started, in microseconds since the epoch.
long
responseStartTimeMillis ()
Returns the time when the processing of the response started, in milliseconds since the epoch.
long
responseStartTimeNanos ()
Returns the time when the processing of the response started, in nanoseconds.
HttpHeaders
responseTrailers ()
Returns the HTTP trailers of the
Response
.
default String
toStringResponseOnly ()
Returns the string representation of the
Response
, with no sanitization of headers or content.
default String
toStringResponseOnly (BiFunction <? super RequestContext ,? super HttpHeaders ,?> headersSanitizer,
BiFunction <? super RequestContext ,Object ,?> contentSanitizer)
Returns the string representation of the
Response
.
String
toStringResponseOnly (BiFunction <? super RequestContext ,? super ResponseHeaders ,?> headersSanitizer,
BiFunction <? super RequestContext ,Object ,?> contentSanitizer,
BiFunction <? super RequestContext ,? super HttpHeaders ,?> trailersSanitizer)
Returns the string representation of the
Response
.
default long
totalDurationNanos ()
Returns the amount of time taken since the
Request
processing started and until the
Response
processing ended.
Methods inherited from interface com.linecorp.armeria.common.logging.RequestLogAccess
availabilityStamp , children , context , ensureAvailable , ensureAvailable , ensureAvailable , ensureComplete , ensureRequestComplete , isAvailable , isAvailable , isAvailable , isComplete , isRequestComplete , parent , partial , whenAvailable , whenAvailable , whenAvailable , whenComplete , whenRequestComplete
Methods inherited from interface com.linecorp.armeria.common.logging.RequestOnlyLog
channel , connectionTimings , fullName , name , rawRequestContent , requestCause , requestContent , requestContentPreview , requestDurationNanos , requestEndTimeNanos , requestFirstBytesTransferredTimeNanos , requestHeaders , requestLength , requestStartTimeMicros , requestStartTimeMillis , requestStartTimeNanos , requestTrailers , scheme , serializationFormat , serviceName , sessionProtocol , sslSession , toStringRequestOnly , toStringRequestOnly , toStringRequestOnly
Method Details
responseStartTimeNanos
long responseStartTimeNanos ()
Returns the time when the processing of the response started, in nanoseconds. This value can only be
used to measure elapsed time and is not related to any other notion of system or wall-clock time.
Throws:
RequestLogAvailabilityException
- if the property is not available yet.
See Also:
RequestLogProperty.RESPONSE_START_TIME
responseFirstBytesTransferredTimeNanos
@Nullable
Long responseFirstBytesTransferredTimeNanos ()
Returns the time when the first bytes of the response headers were transferred over the wire. For a
client, this is the time the client received the data, while for a server it is the time the server sent
them. This value can only be used to measure elapsed time and is not related to any other notion of
system or wall-clock time.
Returns:
the transfer time, or null
if nothing was transferred.
Throws:
RequestLogAvailabilityException
- if the property is not available yet.
See Also:
RequestLogProperty.RESPONSE_FIRST_BYTES_TRANSFERRED_TIME
responseEndTimeNanos
long responseEndTimeNanos ()
Returns the time when the processing of the response finished, in nanoseconds. This value can only be
used to measure elapsed time and is not related to any other notion of system or wall-clock time.
Throws:
RequestLogAvailabilityException
- if the property is not available yet.
See Also:
RequestLogProperty.RESPONSE_END_TIME
responseContent
@Nullable
Object responseContent ()
Returns:
RpcResponse
for RPC, or null
for others
Throws:
RequestLogAvailabilityException
- if the property is not available yet.
See Also:
RequestLogProperty.RESPONSE_CONTENT
rawResponseContent
@Nullable
Object rawResponseContent ()
Returns:
ThriftReply
for Thrift, or null
for others
Throws:
RequestLogAvailabilityException
- if the property is not available yet.
See Also:
RequestLogProperty.RESPONSE_CONTENT
responseContentPreview
@Nullable
String responseContentPreview ()
Returns:
the preview, or null
if preview is disabled.
Throws:
RequestLogAvailabilityException
- if the property is not available yet.
See Also:
RequestLogProperty.RESPONSE_CONTENT_PREVIEW
toStringResponseOnly
default String toStringResponseOnly ()
Returns the string representation of the
Response
, with no sanitization of headers or content.
This method is a shortcut for:
toStringResponseOnly((ctx, headers) -> headers,
(ctx, content) -> content,
(ctx, trailers) -> trailers);
toStringResponseOnly
Returns the string representation of the
Response
. This method is a shortcut for:
toStringResponseOnly(headersSanitizer, contentSanitizer, headersSanitizer);
Parameters:
headersSanitizer
- a BiFunction
for sanitizing HTTP headers for logging. The result of
the BiFunction
is what is actually logged as headers.
contentSanitizer
- a BiFunction
for sanitizing response content for logging. The result of
the BiFunction
is what is actually logged as content.
toStringResponseOnly
Returns the string representation of the
Response
.
Parameters:
headersSanitizer
- a BiFunction
for sanitizing HTTP headers for logging. The result of
the BiFunction
is what is actually logged as headers.
contentSanitizer
- a BiFunction
for sanitizing response content for logging. The result of
the BiFunction
is what is actually logged as content.
trailersSanitizer
- a BiFunction
for sanitizing HTTP trailers for logging. The result of
the BiFunction
is what is actually logged as trailers.