public class DefaultRequestLog extends Object implements RequestLog, RequestLogBuilder
RequestLog implementation.NOOP| Constructor and Description |
|---|
DefaultRequestLog(RequestContext ctx)
Creates a new instance.
|
DefaultRequestLog(RequestContext ctx,
ContentPreviewerFactory requestContentPreviewerFactory,
ContentPreviewerFactory responseContentPreviewerFactory)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(RequestLog child)
Adds the specified
RequestLog so that the logs are propagated from the child. |
void |
addListener(RequestLogListener listener,
Iterable<RequestLogAvailability> availabilities)
Adds the specified
RequestLogListener so that it's notified when all of the specified
RequestLogAvailabilitys are satisfied. |
void |
addListener(RequestLogListener listener,
RequestLogAvailability... availabilities)
Adds the specified
RequestLogListener so that it's notified when all of the specified
RequestLogAvailabilitys are satisfied. |
void |
addListener(RequestLogListener listener,
RequestLogAvailability availability)
Adds the specified
RequestLogListener so that it's notified when the specified
RequestLogAvailability is satisfied. |
<T> io.netty.util.Attribute<T> |
attr(io.netty.util.AttributeKey<T> key) |
Iterator<io.netty.util.Attribute<?>> |
attrs()
Returns all
Attributes set in this log. |
Set<RequestLogAvailability> |
availabilities()
Returns the set of satisfied
RequestLogAvailabilitys. |
io.netty.channel.Channel |
channel()
Returns the Netty
Channel which handled the Request. |
List<RequestLog> |
children()
Returns the list of child
RequestLogs, ordered by the time it was added. |
RequestContext |
context()
Returns the
RequestContext associated with the Request being handled. |
void |
deferRequestContent()
Allows the
RequestLogBuilder.requestContent(Object, Object) called after RequestLogBuilder.endRequest(). |
void |
deferResponseContent()
Allows the
RequestLogBuilder.responseContent(Object, Object) called after RequestLogBuilder.endResponse(). |
void |
endRequest()
Finishes the collection of the
Request information. |
void |
endRequest(long requestEndTimeNanos)
Finishes the collection of the
Request information. |
void |
endRequest(Throwable requestCause)
Finishes the collection of the
Request information. |
void |
endRequest(Throwable requestCause,
long requestEndTimeNanos)
Finishes the collection of the
Request information. |
void |
endResponse()
Finishes the collection of the
Response information. |
void |
endResponse(long responseEndTimeNanos)
Finishes the collection of the
Response information. |
void |
endResponse(Throwable responseCause)
Finishes the collection of the
Response information. |
void |
endResponse(Throwable responseCause,
long responseEndTimeNanos)
Finishes the collection of the
Response information. |
void |
endResponseWithLastChild()
Fills the response-side logs from the last added child.
|
<T> boolean |
hasAttr(io.netty.util.AttributeKey<T> key) |
void |
increaseRequestLength(HttpData data)
|
void |
increaseRequestLength(long deltaBytes)
Increases the
RequestLog.requestLength() by deltaBytes. |
void |
increaseResponseLength(HttpData data)
|
void |
increaseResponseLength(long deltaBytes)
Increases the
RequestLog.responseLength() by deltaBytes. |
boolean |
isAvailable(Iterable<RequestLogAvailability> availabilities)
Returns
true if all of the specified RequestLogAvailabilitys are satisfied. |
boolean |
isAvailable(RequestLogAvailability... availabilities)
Returns
true if all of the specified RequestLogAvailabilitys are satisfied. |
boolean |
isAvailable(RequestLogAvailability availability)
Returns
true if the specified RequestLogAvailability is satisfied. |
boolean |
isRequestContentDeferred()
Returns
true if RequestLogBuilder.deferRequestContent() was ever called. |
boolean |
isResponseContentDeferred()
Returns
true if RequestLogBuilder.deferResponseContent() was ever called. |
Object |
rawRequestContent()
Returns the low-level content object of the
Request, which is specific
to the SerializationFormat. |
Object |
rawResponseContent()
Returns the low-level content object of the
Response, which is specific
to the SerializationFormat. |
Throwable |
requestCause()
Returns the cause of request processing failure.
|
Object |
requestContent()
Returns the high-level content object of the
Request, which is specific
to the SerializationFormat. |
void |
requestContent(Object requestContent,
Object rawRequestContent)
Sets the
RequestLog.requestContent() and the RequestLog.rawRequestContent(). |
String |
requestContentPreview()
Returns the preview of response content of the
Request. |
void |
requestContentPreview(String requestContentPreview)
Sets the
RequestLog.requestContentPreview(). |
long |
requestDurationNanos()
Returns the duration that was taken to consume or produce the request completely, in nanoseconds.
|
long |
requestEndTimeNanos()
Returns the time when the processing of the request finished, in nanoseconds.
|
void |
requestFirstBytesTransferred()
|
void |
requestFirstBytesTransferred(long requestFirstBytesTransferredTimeNanos)
Sets
RequestLog.requestFirstBytesTransferredTimeNanos() with the specified timestamp. |
long |
requestFirstBytesTransferredTimeNanos()
Returns the time when the first bytes of the request headers were transferred over the wire.
|
RequestHeaders |
requestHeaders()
Returns the
RequestHeaders. |
void |
requestHeaders(RequestHeaders requestHeaders)
Sets the
RequestLog.requestHeaders(). |
long |
requestLength()
Returns the length of the request content.
|
void |
requestLength(long requestLength)
Sets the
RequestLog.requestLength(). |
long |
requestStartTimeMicros()
Returns the time when the processing of the request started, in microseconds since the epoch.
|
long |
requestStartTimeMillis()
Returns the time when the processing of the request started, in milliseconds since the epoch.
|
long |
requestStartTimeNanos()
Returns the time when the processing of the request started, in nanoseconds.
|
HttpHeaders |
requestTrailers()
Returns the HTTP trailers of the
Request. |
void |
requestTrailers(HttpHeaders requestTrailers)
Sets the
RequestLog.requestTrailers(). |
Throwable |
responseCause()
Returns the cause of response processing failure.
|
Object |
responseContent()
Returns the high-level content object of the
Response, which is specific
to the SerializationFormat. |
void |
responseContent(Object responseContent,
Object rawResponseContent)
Sets the
RequestLog.responseContent() and the RequestLog.rawResponseContent(). |
String |
responseContentPreview()
Returns the preview of response content of the
Response. |
void |
responseContentPreview(String responseContentPreview)
Sets the
RequestLog.responseContentPreview(). |
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.
|
void |
responseFirstBytesTransferred()
|
void |
responseFirstBytesTransferred(long responseFirstBytesTransferredTimeNanos)
Sets
RequestLog.responseFirstBytesTransferredTimeNanos() with the specified timestamp. |
long |
responseFirstBytesTransferredTimeNanos()
Returns the time when the first bytes of the response headers were transferred over the wire.
|
ResponseHeaders |
responseHeaders()
Returns the non-informational status
ResponseHeaders. |
void |
responseHeaders(ResponseHeaders responseHeaders)
Sets the
RequestLog.responseHeaders(). |
long |
responseLength()
Returns the length of the response content.
|
void |
responseLength(long responseLength)
Sets the
RequestLog.responseLength(). |
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. |
void |
responseTrailers(HttpHeaders responseTrailers)
Sets the
RequestLog.responseTrailers(). |
Scheme |
scheme()
|
SerializationFormat |
serializationFormat()
Returns the
SerializationFormat of the Request. |
void |
serializationFormat(SerializationFormat serializationFormat)
Sets the
SerializationFormat. |
SessionProtocol |
sessionProtocol()
Returns the
SessionProtocol of the Request. |
SSLSession |
sslSession()
Returns the
SSLSession of the connection which handled the Request. |
void |
startRequest(io.netty.channel.Channel channel,
SessionProtocol sessionProtocol,
SSLSession sslSession)
Starts the collection of the
Request information. |
void |
startRequest(io.netty.channel.Channel channel,
SessionProtocol sessionProtocol,
SSLSession sslSession,
long requestStartTimeNanos,
long requestStartTimeMicros)
Starts the collection of the
Request information. |
void |
startResponse()
Starts the collection of
Response information. |
void |
startResponse(long responseStartTimeNanos,
long responseStartTimeMicros)
Starts the collection of
Response information. |
String |
toString() |
String |
toStringRequestOnly()
Returns the string representation of the
Request, with no sanitization of headers or content. |
String |
toStringRequestOnly(Function<? super HttpHeaders,?> headersSanitizer,
Function<Object,?> contentSanitizer)
Returns the string representation of the
Request. |
String |
toStringRequestOnly(Function<? super RequestHeaders,?> headersSanitizer,
Function<Object,?> contentSanitizer,
Function<? super HttpHeaders,?> trailersSanitizer)
Returns the string representation of the
Request. |
String |
toStringResponseOnly()
Returns the string representation of the
Response, with no sanitization of headers or content. |
String |
toStringResponseOnly(Function<? super HttpHeaders,?> headersSanitizer,
Function<Object,?> contentSanitizer)
Returns the string representation of the
Response. |
String |
toStringResponseOnly(Function<? super ResponseHeaders,?> headersSanitizer,
Function<Object,?> contentSanitizer,
Function<? super HttpHeaders,?> trailersSanitizer)
Returns the string representation of the
Response. |
long |
totalDurationNanos()
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitauthority, decodedPath, ensureAvailability, ensureAvailability, ensureAvailability, host, id, method, path, query, status, statusCodestartRequest, startRequestpublic DefaultRequestLog(RequestContext ctx)
public DefaultRequestLog(RequestContext ctx, ContentPreviewerFactory requestContentPreviewerFactory, ContentPreviewerFactory responseContentPreviewerFactory)
public <T> io.netty.util.Attribute<T> attr(io.netty.util.AttributeKey<T> key)
attr in interface io.netty.util.AttributeMappublic <T> boolean hasAttr(io.netty.util.AttributeKey<T> key)
hasAttr in interface io.netty.util.AttributeMappublic Iterator<io.netty.util.Attribute<?>> attrs()
RequestLogAttributes set in this log.attrs in interface RequestLogpublic void addChild(RequestLog child)
RequestLogBuilderRequestLog so that the logs are propagated from the child.
Note that only the request-side logs of the first added child will be propagated. To fill the
response-side logs you need to call RequestLogBuilder.endResponseWithLastChild().addChild in interface RequestLogBuilderpublic void endResponseWithLastChild()
RequestLogBuilderRequestLogAvailabilitys in the child log will be propagated immediately.endResponseWithLastChild in interface RequestLogBuilderpublic List<RequestLog> children()
RequestLogRequestLogs, ordered by the time it was added.children in interface RequestLogpublic Set<RequestLogAvailability> availabilities()
RequestLogRequestLogAvailabilitys.availabilities in interface RequestLogpublic boolean isAvailable(RequestLogAvailability availability)
RequestLogtrue if the specified RequestLogAvailability is satisfied.isAvailable in interface RequestLogpublic boolean isAvailable(RequestLogAvailability... availabilities)
RequestLogtrue if all of the specified RequestLogAvailabilitys are satisfied.isAvailable in interface RequestLogpublic boolean isAvailable(Iterable<RequestLogAvailability> availabilities)
RequestLogtrue if all of the specified RequestLogAvailabilitys are satisfied.isAvailable in interface RequestLogpublic void addListener(RequestLogListener listener, RequestLogAvailability availability)
RequestLogRequestLogListener so that it's notified when the specified
RequestLogAvailability is satisfied.addListener in interface RequestLogpublic void addListener(RequestLogListener listener, RequestLogAvailability... availabilities)
RequestLogRequestLogListener so that it's notified when all of the specified
RequestLogAvailabilitys are satisfied.addListener in interface RequestLogpublic void addListener(RequestLogListener listener, Iterable<RequestLogAvailability> availabilities)
RequestLogRequestLogListener so that it's notified when all of the specified
RequestLogAvailabilitys are satisfied.addListener in interface RequestLogpublic RequestContext context()
RequestLogRequestContext associated with the Request being handled.
This method returns non-null regardless the current RequestLogAvailability.context in interface RequestLogpublic void startRequest(io.netty.channel.Channel channel,
SessionProtocol sessionProtocol,
@Nullable
SSLSession sslSession)
RequestLogBuilderRequest information. This method sets the following properties:
startRequest in interface RequestLogBuilderchannel - the Channel which handled the Request.sessionProtocol - the SessionProtocol of the connection.sslSession - the SSLSession of the connection, or null.public void startRequest(io.netty.channel.Channel channel,
SessionProtocol sessionProtocol,
@Nullable
SSLSession sslSession,
long requestStartTimeNanos,
long requestStartTimeMicros)
RequestLogBuilderRequest information. This method sets the following properties:
startRequest in interface RequestLogBuilderchannel - the Channel which handled the Request.sessionProtocol - the SessionProtocol of the connection.sslSession - the SSLSession of the connection, or null.requestStartTimeNanos - System.nanoTime() value when the request started.requestStartTimeMicros - the number of microseconds since the epoch,
e.g. System.currentTimeMillis() * 1000.public long requestStartTimeMicros()
RequestLogrequestStartTimeMicros in interface RequestLogpublic long requestStartTimeMillis()
RequestLogrequestStartTimeMillis in interface RequestLogpublic long requestStartTimeNanos()
RequestLogrequestStartTimeNanos in interface RequestLogpublic long requestFirstBytesTransferredTimeNanos()
RequestLogrequestFirstBytesTransferredTimeNanos in interface RequestLogpublic long requestEndTimeNanos()
RequestLogrequestEndTimeNanos in interface RequestLogpublic long requestDurationNanos()
RequestLogrequestDurationNanos in interface RequestLogpublic Throwable requestCause()
RequestLogrequestCause in interface RequestLognull if the request was processed completely.public io.netty.channel.Channel channel()
RequestLogChannel which handled the Request.channel in interface RequestLogChannel. null if the Request has failed even before
a connection is established.public SSLSession sslSession()
RequestLogSSLSession of the connection which handled the Request.sslSession in interface RequestLogSSLSession, or null if the Request has failed even before
a TLS connection is established.public SessionProtocol sessionProtocol()
RequestLogSessionProtocol of the Request.sessionProtocol in interface RequestLogpublic SerializationFormat serializationFormat()
RequestLogSerializationFormat of the Request.serializationFormat in interface RequestLogpublic void serializationFormat(SerializationFormat serializationFormat)
RequestLogBuilderSerializationFormat.serializationFormat in interface RequestLogBuilderpublic Scheme scheme()
RequestLogscheme in interface RequestLogpublic long requestLength()
RequestLogrequestLength in interface RequestLogpublic void requestLength(long requestLength)
RequestLogBuilderRequestLog.requestLength().requestLength in interface RequestLogBuilderpublic void requestFirstBytesTransferred()
RequestLogBuilderrequestFirstBytesTransferred in interface RequestLogBuilderpublic void requestFirstBytesTransferred(long requestFirstBytesTransferredTimeNanos)
RequestLogBuilderRequestLog.requestFirstBytesTransferredTimeNanos() with the specified timestamp.requestFirstBytesTransferred in interface RequestLogBuilderpublic void increaseRequestLength(long deltaBytes)
RequestLogBuilderRequestLog.requestLength() by deltaBytes.increaseRequestLength in interface RequestLogBuilderpublic void increaseRequestLength(HttpData data)
RequestLogBuilderincreaseRequestLength in interface RequestLogBuilderpublic RequestHeaders requestHeaders()
RequestLogRequestHeaders. If the Request was not received or sent at all,
it will return a dummy RequestHeaders whose :authority and :path are
set to "?", :scheme is set to "http" or "https", and :method is
set to "UNKNOWN".requestHeaders in interface RequestLogpublic void requestHeaders(RequestHeaders requestHeaders)
RequestLogBuilderRequestLog.requestHeaders().requestHeaders in interface RequestLogBuilderpublic Object requestContent()
RequestLogRequest, which is specific
to the SerializationFormat.requestContent in interface RequestLogRpcRequest for RPC, or null for otherspublic void requestContent(@Nullable Object requestContent, @Nullable Object rawRequestContent)
RequestLogBuilderRequestLog.requestContent() and the RequestLog.rawRequestContent().
If the specified requestContent is an RpcRequest and
the RequestContext.rpcRequest() is null, this method will call
RequestContext.updateRpcRequest(RpcRequest).requestContent in interface RequestLogBuilderpublic String requestContentPreview()
RequestLogRequest.
Note that the content preview needs to be enabled when configuring a Server or a Client
to use this functionality.requestContentPreview in interface RequestLognull if preview is not available or disabled.ServerBuilder.contentPreview(int),
ServerBuilder.requestContentPreviewerFactory(ContentPreviewerFactory),
VirtualHostBuilder.contentPreview(int),
VirtualHostBuilder.requestContentPreviewerFactory(ContentPreviewerFactory),
AbstractClientOptionsBuilder.requestContentPreviewerFactory(ContentPreviewerFactory),
AbstractClientOptionsBuilder.contentPreview(int)public void requestContentPreview(@Nullable String requestContentPreview)
RequestLogBuilderRequestLog.requestContentPreview().requestContentPreview in interface RequestLogBuilderpublic Object rawRequestContent()
RequestLogRequest, which is specific
to the SerializationFormat.rawRequestContent in interface RequestLogThriftCall for Thrift, or null for otherspublic void deferRequestContent()
RequestLogBuilderRequestLogBuilder.requestContent(Object, Object) called after RequestLogBuilder.endRequest().
By default, if RequestLogBuilder.requestContent(Object, Object) was not called yet, RequestLogBuilder.endRequest() will
call requestContent(null, null) automatically. This method turns off this default behavior.
Note, however, this method will not prevent RequestLogBuilder.endRequest(Throwable) from calling
requestContent(null, null) automatically.deferRequestContent in interface RequestLogBuilderpublic boolean isRequestContentDeferred()
RequestLogBuildertrue if RequestLogBuilder.deferRequestContent() was ever called.isRequestContentDeferred in interface RequestLogBuilderpublic HttpHeaders requestTrailers()
RequestLogRequest.requestTrailers in interface RequestLogpublic void requestTrailers(HttpHeaders requestTrailers)
RequestLogBuilderRequestLog.requestTrailers().requestTrailers in interface RequestLogBuilderpublic void endRequest()
RequestLogBuilderRequest information. This method sets the following properties:
endRequest in interface RequestLogBuilderpublic void endRequest(Throwable requestCause)
RequestLogBuilderRequest information. This method sets the following properties:
endRequest in interface RequestLogBuilderrequestCause - the cause of the failure.public void endRequest(long requestEndTimeNanos)
RequestLogBuilderRequest information. This method sets the following properties:
endRequest in interface RequestLogBuilderrequestEndTimeNanos - System.nanoTime() value when the request ended.public void endRequest(Throwable requestCause, long requestEndTimeNanos)
RequestLogBuilderRequest information. This method sets the following properties:
endRequest in interface RequestLogBuilderrequestCause - the cause of the failure.requestEndTimeNanos - System.nanoTime() value when the request ended.public void startResponse()
RequestLogBuilderResponse information. This method sets the following properties:
startResponse in interface RequestLogBuilderpublic void startResponse(long responseStartTimeNanos,
long responseStartTimeMicros)
RequestLogBuilderResponse information. This method sets the following properties:
startResponse in interface RequestLogBuilderresponseStartTimeNanos - System.nanoTime() value when the response started.responseStartTimeMicros - the number of microseconds since the epoch,
e.g. System.currentTimeMillis() * 1000.public long responseStartTimeMicros()
RequestLogresponseStartTimeMicros in interface RequestLogpublic long responseStartTimeMillis()
RequestLogresponseStartTimeMillis in interface RequestLogpublic long responseStartTimeNanos()
RequestLogresponseStartTimeNanos in interface RequestLogpublic long responseFirstBytesTransferredTimeNanos()
RequestLogresponseFirstBytesTransferredTimeNanos in interface RequestLogpublic long responseEndTimeNanos()
RequestLogresponseEndTimeNanos in interface RequestLogpublic long responseDurationNanos()
RequestLogresponseDurationNanos in interface RequestLogpublic Throwable responseCause()
RequestLogresponseCause in interface RequestLognull if the response was processed completely.public long responseLength()
RequestLogresponseLength in interface RequestLogpublic void responseLength(long responseLength)
RequestLogBuilderRequestLog.responseLength().responseLength in interface RequestLogBuilderpublic void responseFirstBytesTransferred()
RequestLogBuilderresponseFirstBytesTransferred in interface RequestLogBuilderpublic void responseFirstBytesTransferred(long responseFirstBytesTransferredTimeNanos)
RequestLogBuilderRequestLog.responseFirstBytesTransferredTimeNanos() with the specified timestamp.responseFirstBytesTransferred in interface RequestLogBuilderpublic void increaseResponseLength(long deltaBytes)
RequestLogBuilderRequestLog.responseLength() by deltaBytes.increaseResponseLength in interface RequestLogBuilderpublic void increaseResponseLength(HttpData data)
RequestLogBuilderincreaseResponseLength in interface RequestLogBuilderpublic ResponseHeaders responseHeaders()
RequestLogResponseHeaders.
If the Response was not received or sent at all, it will return a dummy
ResponseHeaders whose :status is "0".responseHeaders in interface RequestLogpublic void responseHeaders(ResponseHeaders responseHeaders)
RequestLogBuilderRequestLog.responseHeaders().responseHeaders in interface RequestLogBuilderpublic Object responseContent()
RequestLogResponse, which is specific
to the SerializationFormat.responseContent in interface RequestLogRpcResponse for RPC, or null for otherspublic void responseContent(@Nullable Object responseContent, @Nullable Object rawResponseContent)
RequestLogBuilderRequestLog.responseContent() and the RequestLog.rawResponseContent().responseContent in interface RequestLogBuilderpublic String responseContentPreview()
RequestLogResponse.
Note that the content preview needs to be enabled when configuring a Server or a Client
to use this functionality.responseContentPreview in interface RequestLognull if preview is not available or disabled.ServerBuilder.contentPreview(int),
ServerBuilder.responseContentPreviewerFactory(ContentPreviewerFactory),
VirtualHostBuilder.contentPreview(int),
VirtualHostBuilder.responseContentPreviewerFactory(ContentPreviewerFactory),
AbstractClientOptionsBuilder.responseContentPreviewerFactory(ContentPreviewerFactory),
AbstractClientOptionsBuilder.contentPreview(int)public void responseContentPreview(@Nullable String responseContentPreview)
RequestLogBuilderRequestLog.responseContentPreview().responseContentPreview in interface RequestLogBuilderpublic Object rawResponseContent()
RequestLogResponse, which is specific
to the SerializationFormat.rawResponseContent in interface RequestLogThriftReply for Thrift, or null for otherspublic void deferResponseContent()
RequestLogBuilderRequestLogBuilder.responseContent(Object, Object) called after RequestLogBuilder.endResponse().
By default, if RequestLogBuilder.responseContent(Object, Object) was not called yet, RequestLogBuilder.endResponse() will
call responseContent(null, null) automatically. This method turns off this default behavior.
Note, however, this method will not prevent RequestLogBuilder.endResponse(Throwable) from calling
responseContent(null, null) automatically.deferResponseContent in interface RequestLogBuilderpublic boolean isResponseContentDeferred()
RequestLogBuildertrue if RequestLogBuilder.deferResponseContent() was ever called.isResponseContentDeferred in interface RequestLogBuilderpublic HttpHeaders responseTrailers()
RequestLogResponse.responseTrailers in interface RequestLogpublic void responseTrailers(HttpHeaders responseTrailers)
RequestLogBuilderRequestLog.responseTrailers().responseTrailers in interface RequestLogBuilderpublic void endResponse()
RequestLogBuilderResponse information. If a Throwable cause has been set
with RequestLogBuilder.responseContent(Object, Object), it will be treated as the responseCause for this
log. This method sets the following properties:
endResponse in interface RequestLogBuilderpublic void endResponse(Throwable responseCause)
RequestLogBuilderResponse information. This method sets the following properties:
endResponse in interface RequestLogBuilderresponseCause - the cause of the failure.public void endResponse(long responseEndTimeNanos)
RequestLogBuilderResponse information. If a Throwable cause has been set
with RequestLogBuilder.responseContent(Object, Object), it will be treated as the responseCause for this
log. This method sets the following properties:
endResponse in interface RequestLogBuilderresponseEndTimeNanos - System.nanoTime() value when the response ended.public void endResponse(Throwable responseCause, long responseEndTimeNanos)
RequestLogBuilderResponse information. This method sets the following properties:
endResponse in interface RequestLogBuilderresponseCause - the cause of the failure.responseEndTimeNanos - System.nanoTime() value when the response ended.public long totalDurationNanos()
RequestLogRequest processing started and until the
Response processing ended. This property is available only when both
RequestLogAvailability.REQUEST_START and RequestLogAvailability.RESPONSE_END are
available.totalDurationNanos in interface RequestLogpublic String toStringRequestOnly()
RequestLogRequest, with no sanitization of headers or content.toStringRequestOnly in interface RequestLogpublic String toStringRequestOnly(Function<? super HttpHeaders,?> headersSanitizer, Function<Object,?> contentSanitizer)
RequestLogRequest. This method is a shortcut of:
toStringRequestOnly(headersSanitizer, contentSanitizer, headersSanitizer);
toStringRequestOnly in interface RequestLogheadersSanitizer - a Function for sanitizing HTTP headers for logging. The result of the
Function is what is actually logged as headers.contentSanitizer - a Function for sanitizing request content for logging. The result of the
Function is what is actually logged as content.public String toStringRequestOnly(Function<? super RequestHeaders,?> headersSanitizer, Function<Object,?> contentSanitizer, Function<? super HttpHeaders,?> trailersSanitizer)
RequestLogRequest.toStringRequestOnly in interface RequestLogheadersSanitizer - a Function for sanitizing HTTP headers for logging. The result of the
Function is what is actually logged as headers.contentSanitizer - a Function for sanitizing request content for logging. The result of the
Function is what is actually logged as content.trailersSanitizer - a Function for sanitizing HTTP trailers for logging. The result of the
Function is what is actually logged as trailers.public String toStringResponseOnly()
RequestLogResponse, with no sanitization of headers or content.toStringResponseOnly in interface RequestLogpublic String toStringResponseOnly(Function<? super HttpHeaders,?> headersSanitizer, Function<Object,?> contentSanitizer)
RequestLogResponse. This method is a shortcut of:
toStringResponseOnly(headersSanitizer, contentSanitizer, headersSanitizer);
toStringResponseOnly in interface RequestLogheadersSanitizer - a Function for sanitizing HTTP headers for logging. The result of the
Function is what is actually logged as headers.contentSanitizer - a Function for sanitizing response content for logging. The result of the
Function is what is actually logged as content.public String toStringResponseOnly(Function<? super ResponseHeaders,?> headersSanitizer, Function<Object,?> contentSanitizer, Function<? super HttpHeaders,?> trailersSanitizer)
RequestLogResponse.toStringResponseOnly in interface RequestLogheadersSanitizer - a Function for sanitizing HTTP headers for logging. The result of the
Function is what is actually logged as headers.contentSanitizer - a Function for sanitizing response content for logging. The result of the
Function is what is actually logged as content.trailersSanitizer - a Function for sanitizing HTTP trailers for logging. The result of the
Function is what is actually logged as trailers.Copyright © 2020 LeanCloud. All rights reserved.