Interface RequestLogBuilder
-
- All Known Implementing Classes:
DefaultRequestLog
public interface RequestLogBuilder
Updates aRequestLog
with newly available information.
-
-
Field Summary
Fields Modifier and Type Field Description static RequestLogBuilder
NOOP
A dummyRequestLogBuilder
that discards everything it collected.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addChild(RequestLog child)
Adds the specifiedRequestLog
so that the logs are propagated from thechild
.void
deferRequestContent()
Allows therequestContent(Object, Object)
called afterendRequest()
.void
deferResponseContent()
Allows theresponseContent(Object, Object)
called afterendResponse()
.void
endRequest()
SetsRequestLog.requestDurationNanos()
and finishes the collection of the information.void
endRequest(Throwable requestCause)
SetsRequestLog.requestDurationNanos()
and finishes the collection of the information.void
endResponse()
SetsRequestLog.responseDurationNanos()
and finishes the collection of the information.void
endResponse(Throwable responseCause)
SetsRequestLog.responseDurationNanos()
and finishes the collection of the information.void
endResponseWithLastChild()
Fills the response-side logs from the last added child.void
increaseRequestLength(long deltaBytes)
Increases theRequestLog.requestLength()
bydeltaBytes
.void
increaseResponseLength(long deltaBytes)
Increases theRequestLog.responseLength()
bydeltaBytes
.boolean
isRequestContentDeferred()
Returnstrue
ifdeferRequestContent()
was ever called.boolean
isResponseContentDeferred()
Returnstrue
ifdeferResponseContent()
was ever called.void
requestContent(Object requestContent, Object rawRequestContent)
Sets theRequestLog.requestContent()
and theRequestLog.rawRequestContent()
.void
requestHeaders(HttpHeaders requestHeaders)
Sets theRequestLog.requestHeaders()
.void
requestLength(long requestLength)
Sets theRequestLog.requestLength()
.void
responseContent(Object responseContent, Object rawResponseContent)
Sets theRequestLog.responseContent()
and theRequestLog.rawResponseContent()
.void
responseHeaders(HttpHeaders responseHeaders)
Sets theRequestLog.responseHeaders()
.void
responseLength(long responseLength)
Sets theRequestLog.responseLength()
.void
serializationFormat(SerializationFormat serializationFormat)
Sets theSerializationFormat
.void
startRequest(Channel channel, SessionProtocol sessionProtocol)
Starts the collection of information for theRequest
.default void
startRequest(Channel channel, SessionProtocol sessionProtocol, String host)
Deprecated.void
startResponse()
Starts the collection of information for theResponse
.
-
-
-
Field Detail
-
NOOP
static final RequestLogBuilder NOOP
A dummyRequestLogBuilder
that discards everything it collected.
-
-
Method Detail
-
addChild
void addChild(RequestLog child)
Adds the specifiedRequestLog
so that the logs are propagated from thechild
. Note that only the request-side logs of the first added child will be propagated. To fill the response-side logs you need to callendResponseWithLastChild()
.
-
endResponseWithLastChild
void endResponseWithLastChild()
Fills the response-side logs from the last added child. Note that already fulfilledRequestLogAvailability
s in the child log will be propagated immediately.
-
startRequest
void startRequest(Channel channel, SessionProtocol sessionProtocol)
Starts the collection of information for theRequest
. This method sets the following properties:
-
startRequest
@Deprecated default void startRequest(Channel channel, SessionProtocol sessionProtocol, String host)
Deprecated.Starts the collection of information for theRequest
. This method sets the following properties:
-
serializationFormat
void serializationFormat(SerializationFormat serializationFormat)
Sets theSerializationFormat
.
-
increaseRequestLength
void increaseRequestLength(long deltaBytes)
Increases theRequestLog.requestLength()
bydeltaBytes
.
-
requestLength
void requestLength(long requestLength)
Sets theRequestLog.requestLength()
.
-
requestHeaders
void requestHeaders(HttpHeaders requestHeaders)
Sets theRequestLog.requestHeaders()
.
-
requestContent
void requestContent(@Nullable Object requestContent, @Nullable Object rawRequestContent)
Sets theRequestLog.requestContent()
and theRequestLog.rawRequestContent()
.
-
deferRequestContent
void deferRequestContent()
Allows therequestContent(Object, Object)
called afterendRequest()
. By default, ifrequestContent(Object, Object)
was not called yet,endRequest()
will callrequestContent(null, null)
automatically. This method turns off this default behavior. Note, however, this method will not preventendRequest(Throwable)
from callingrequestContent(null, null)
automatically.
-
isRequestContentDeferred
boolean isRequestContentDeferred()
Returnstrue
ifdeferRequestContent()
was ever called.
-
endRequest
void endRequest()
SetsRequestLog.requestDurationNanos()
and finishes the collection of the information.
-
endRequest
void endRequest(Throwable requestCause)
SetsRequestLog.requestDurationNanos()
and finishes the collection of the information.
-
startResponse
void startResponse()
Starts the collection of information for theResponse
. This method setsRequestLog.responseStartTimeMillis()
.
-
increaseResponseLength
void increaseResponseLength(long deltaBytes)
Increases theRequestLog.responseLength()
bydeltaBytes
.
-
responseLength
void responseLength(long responseLength)
Sets theRequestLog.responseLength()
.
-
responseHeaders
void responseHeaders(HttpHeaders responseHeaders)
Sets theRequestLog.responseHeaders()
.
-
responseContent
void responseContent(@Nullable Object responseContent, @Nullable Object rawResponseContent)
Sets theRequestLog.responseContent()
and theRequestLog.rawResponseContent()
.
-
deferResponseContent
void deferResponseContent()
Allows theresponseContent(Object, Object)
called afterendResponse()
. By default, ifresponseContent(Object, Object)
was not called yet,endResponse()
will callresponseContent(null, null)
automatically. This method turns off this default behavior. Note, however, this method will not preventendResponse(Throwable)
from callingresponseContent(null, null)
automatically.
-
isResponseContentDeferred
boolean isResponseContentDeferred()
Returnstrue
ifdeferResponseContent()
was ever called.
-
endResponse
void endResponse()
SetsRequestLog.responseDurationNanos()
and finishes the collection of the information. If aThrowable
cause has been set withresponseContent(Object, Object)
, it will be treated as theresponseCause
for this log.
-
endResponse
void endResponse(Throwable responseCause)
SetsRequestLog.responseDurationNanos()
and finishes the collection of the information.
-
-