public interface RequestLogBuilder
RequestLog with newly available information.| Modifier and Type | Field and Description |
|---|---|
static RequestLogBuilder |
NOOP
Deprecated.
This field will be removed without a replacement. Use
DefaultRequestLog or a mock. |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(RequestLog child)
Adds the specified
RequestLog so that the logs are propagated from the child. |
void |
deferRequestContent()
Allows the
requestContent(Object, Object) called after endRequest(). |
void |
deferResponseContent()
Allows the
responseContent(Object, Object) called after 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.
|
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 |
isRequestContentDeferred()
Returns
true if deferRequestContent() was ever called. |
boolean |
isResponseContentDeferred()
Returns
true if deferResponseContent() was ever called. |
void |
requestContent(Object requestContent,
Object rawRequestContent)
Sets the
RequestLog.requestContent() and the RequestLog.rawRequestContent(). |
void |
requestContentPreview(String requestContentPreview)
Sets the
RequestLog.requestContentPreview(). |
void |
requestFirstBytesTransferred()
|
void |
requestFirstBytesTransferred(long requestFirstBytesTransferredNanos)
Sets
RequestLog.requestFirstBytesTransferredTimeNanos() with the specified timestamp. |
void |
requestHeaders(RequestHeaders requestHeaders)
Sets the
RequestLog.requestHeaders(). |
void |
requestLength(long requestLength)
Sets the
RequestLog.requestLength(). |
void |
requestTrailers(HttpHeaders requestTrailers)
Sets the
RequestLog.requestTrailers(). |
void |
responseContent(Object responseContent,
Object rawResponseContent)
Sets the
RequestLog.responseContent() and the RequestLog.rawResponseContent(). |
void |
responseContentPreview(String responseContentPreview)
Sets the
RequestLog.responseContentPreview(). |
void |
responseFirstBytesTransferred()
|
void |
responseFirstBytesTransferred(long responseFirstBytesTransferredNanos)
Sets
RequestLog.responseFirstBytesTransferredTimeNanos() with the specified timestamp. |
void |
responseHeaders(ResponseHeaders responseHeaders)
Sets the
RequestLog.responseHeaders(). |
void |
responseLength(long responseLength)
Sets the
RequestLog.responseLength(). |
void |
responseTrailers(HttpHeaders responseTrailers)
Sets the
RequestLog.responseTrailers(). |
void |
serializationFormat(SerializationFormat serializationFormat)
Sets the
SerializationFormat. |
default void |
startRequest(io.netty.channel.Channel channel,
SessionProtocol sessionProtocol)
Starts the collection of the
Request information. |
default void |
startRequest(io.netty.channel.Channel channel,
SessionProtocol sessionProtocol,
long requestStartTimeNanos,
long requestStartTimeMicros)
Starts the collection of the
Request information. |
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. |
@Deprecated static final RequestLogBuilder NOOP
DefaultRequestLog or a mock.RequestLogBuilder that discards everything it collected.void addChild(RequestLog child)
RequestLog 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 endResponseWithLastChild().void endResponseWithLastChild()
RequestLogAvailabilitys in the child log will be propagated immediately.default void startRequest(io.netty.channel.Channel channel,
SessionProtocol sessionProtocol)
Request information. This method sets the following properties:
channel - the Channel which handled the Request.sessionProtocol - the SessionProtocol of the connection.void startRequest(io.netty.channel.Channel channel,
SessionProtocol sessionProtocol,
@Nullable
SSLSession sslSession)
Request information. This method sets the following properties:
channel - the Channel which handled the Request.sessionProtocol - the SessionProtocol of the connection.sslSession - the SSLSession of the connection, or null.default void startRequest(io.netty.channel.Channel channel,
SessionProtocol sessionProtocol,
long requestStartTimeNanos,
long requestStartTimeMicros)
Request information. This method sets the following properties:
channel - the Channel which handled the Request.sessionProtocol - the SessionProtocol of the connection.requestStartTimeNanos - System.nanoTime() value when the request started.requestStartTimeMicros - the number of microseconds since the epoch,
e.g. System.currentTimeMillis() * 1000.void startRequest(io.netty.channel.Channel channel,
SessionProtocol sessionProtocol,
@Nullable
SSLSession sslSession,
long requestStartTimeNanos,
long requestStartTimeMicros)
Request information. This method sets the following properties:
channel - 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.void serializationFormat(SerializationFormat serializationFormat)
SerializationFormat.void increaseRequestLength(long deltaBytes)
RequestLog.requestLength() by deltaBytes.void increaseRequestLength(HttpData data)
void requestLength(long requestLength)
RequestLog.requestLength().void requestFirstBytesTransferred()
void requestFirstBytesTransferred(long requestFirstBytesTransferredNanos)
RequestLog.requestFirstBytesTransferredTimeNanos() with the specified timestamp.void requestHeaders(RequestHeaders requestHeaders)
RequestLog.requestHeaders().void requestContent(@Nullable Object requestContent, @Nullable Object rawRequestContent)
RequestLog.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).void requestContentPreview(@Nullable String requestContentPreview)
RequestLog.requestContentPreview().void deferRequestContent()
requestContent(Object, Object) called after endRequest().
By default, if requestContent(Object, Object) was not called yet, endRequest() will
call requestContent(null, null) automatically. This method turns off this default behavior.
Note, however, this method will not prevent endRequest(Throwable) from calling
requestContent(null, null) automatically.boolean isRequestContentDeferred()
true if deferRequestContent() was ever called.void requestTrailers(HttpHeaders requestTrailers)
RequestLog.requestTrailers().void endRequest()
Request information. This method sets the following properties:
void endRequest(Throwable requestCause)
Request information. This method sets the following properties:
requestCause - the cause of the failure.void endRequest(long requestEndTimeNanos)
Request information. This method sets the following properties:
requestEndTimeNanos - System.nanoTime() value when the request ended.void endRequest(Throwable requestCause, long requestEndTimeNanos)
Request information. This method sets the following properties:
requestCause - the cause of the failure.requestEndTimeNanos - System.nanoTime() value when the request ended.void startResponse()
Response information. This method sets the following properties:
void startResponse(long responseStartTimeNanos,
long responseStartTimeMicros)
Response information. This method sets the following properties:
responseStartTimeNanos - System.nanoTime() value when the response started.responseStartTimeMicros - the number of microseconds since the epoch,
e.g. System.currentTimeMillis() * 1000.void increaseResponseLength(long deltaBytes)
RequestLog.responseLength() by deltaBytes.void increaseResponseLength(HttpData data)
void responseLength(long responseLength)
RequestLog.responseLength().void responseFirstBytesTransferred()
void responseFirstBytesTransferred(long responseFirstBytesTransferredNanos)
RequestLog.responseFirstBytesTransferredTimeNanos() with the specified timestamp.void responseHeaders(ResponseHeaders responseHeaders)
RequestLog.responseHeaders().void responseContent(@Nullable Object responseContent, @Nullable Object rawResponseContent)
RequestLog.responseContent() and the RequestLog.rawResponseContent().void responseContentPreview(@Nullable String responseContentPreview)
RequestLog.responseContentPreview().void deferResponseContent()
responseContent(Object, Object) called after endResponse().
By default, if responseContent(Object, Object) was not called yet, endResponse() will
call responseContent(null, null) automatically. This method turns off this default behavior.
Note, however, this method will not prevent endResponse(Throwable) from calling
responseContent(null, null) automatically.boolean isResponseContentDeferred()
true if deferResponseContent() was ever called.void responseTrailers(HttpHeaders responseTrailers)
RequestLog.responseTrailers().void endResponse()
Response information. If a Throwable cause has been set
with responseContent(Object, Object), it will be treated as the responseCause for this
log. This method sets the following properties:
void endResponse(Throwable responseCause)
Response information. This method sets the following properties:
responseCause - the cause of the failure.void endResponse(long responseEndTimeNanos)
Response information. If a Throwable cause has been set
with responseContent(Object, Object), it will be treated as the responseCause for this
log. This method sets the following properties:
responseEndTimeNanos - System.nanoTime() value when the response ended.void endResponse(Throwable responseCause, long responseEndTimeNanos)
Response information. This method sets the following properties:
responseCause - the cause of the failure.responseEndTimeNanos - System.nanoTime() value when the response ended.Copyright © 2020 LeanCloud. All rights reserved.