Interface RestClientDebugFormatter
- All Known Implementing Classes:
BasicRestClientDebugFormatter
The client debug pipeline invokes these methods cumulatively based on the resolved logger level:
formatBasic(RestRequest, RestResponse)atINFO.formatHeaders(RestRequest, RestResponse)added atFINE.formatBody(RestRequest, RestResponse)added atFINEST.
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault intbodyCap()Maximum number of request/response body bytes to capture forFINESTrendering.formatBasic(RestRequest req, RestResponse res) Renders the basic (INFO-tier) portion of a debug record.default StringformatBody(RestRequest req, RestResponse res) Renders the body (FINEST-tier) portion of a debug record.default StringformatHeaders(RestRequest req, RestResponse res) Renders the headers (FINE-tier) portion of a debug record.default booleanisBodyRenderable(String contentType) Returnstrue if a body with the given content type is worth rendering as text (as opposed to being binary/unknown).
-
Method Details
-
formatBasic
Renders the basic (INFO-tier) portion of a debug record.- Parameters:
req- The request.res- The response.- Returns:
- The formatted message chunk.
-
formatHeaders
Renders the headers (FINE-tier) portion of a debug record.- Parameters:
req- The request.res- The response.- Returns:
- The formatted message chunk.
-
formatBody
Renders the body (FINEST-tier) portion of a debug record.- Parameters:
req- The request.res- The response.- Returns:
- The formatted message chunk.
-
bodyCap
Maximum number of request/response body bytes to capture forFINESTrendering.- Returns:
- The capture cap in bytes.
-
isBodyRenderable
Returnstrue if a body with the given content type is worth rendering as text (as opposed to being binary/unknown).This is a text-vs-binary renderability predicate, not a redaction allowlist. It parses only the media type (type/subtype, ignoring parameters such as
; charset=utf-8), case-folds, and treats the following as renderable:text/*,application/json,application/xml, any+json/+xmlsuffix, andapplication/x-www-form-urlencoded.multipart/form-datais explicitly non-renderable. An absent or blank content type is conservatively treated as non-renderable.Content-Encodingis not visible to this one-argument predicate; a caller that dumps bodies must separately treat any non-identity encoding (e.g.gzip) as non-renderable.Keep byte-identical to
org.apache.juneau.rest.server.logging.RestDebugFormatter's counterpart.- Parameters:
contentType- The body's content type. Can benull (returnsfalse ).- Returns:
true if the content type is renderable as text.
-