$SUMMARY_MESSAGE_FORMAT
$SUMMARY_MESSAGE_FORMAT :
Stores and formats logging information about a single Guzzle API call.
__construct(array<mixed,string> $requestHttpHeadersToScrub,array<mixed,string> $additionalSummaryInfo,boolean $shouldLogResponsePayload,string|null $redactedResponsePayloadMessage = null,\GuzzleHttp\MessageFormatter|null $summaryMessageFormatter = null,\GuzzleHttp\MessageFormatter|null $detailedMessageFormatter = null)
Creates a new Guzzle log formatter with the specified settings.
array<mixed,string> | $requestHttpHeadersToScrub | a list of request HTTP headers to scrub |
array<mixed,string> | $additionalSummaryInfo | an associative array of additional info for formatting a message as summary |
boolean | $shouldLogResponsePayload | whether the logger should log response payload |
string|null | $redactedResponsePayloadMessage | the message to be used when the response payload is redacted |
\GuzzleHttp\MessageFormatter|null | $summaryMessageFormatter | the Guzzle message formatter for summary formatting |
\GuzzleHttp\MessageFormatter|null | $detailedMessageFormatter | the Guzzle message formatter for detailed formatting |
formatSummary(\Psr\Http\Message\RequestInterface $request,\Psr\Http\Message\ResponseInterface|null $response = null): string
Formats this log message as a summary line.
\Psr\Http\Message\RequestInterface | $request | the HTTP request |
\Psr\Http\Message\ResponseInterface|null | $response | the HTTP response |
the formatted summary log message
formatDetailed(\Psr\Http\Message\RequestInterface $request,\Psr\Http\Message\ResponseInterface $response = null,\Exception $error = null): string
Formats a detailed message based on the specified HTTP request and response, and errors, if present. This function also replaces the original response with a new one with a seekable stream, if the original one contains forward-only stream.
\Psr\Http\Message\RequestInterface | $request | the HTTP request |
\Psr\Http\Message\ResponseInterface | $response | |
\Exception | $error |
the formatted detailed log message
scrubAndFormatDetailedMessage(\Psr\Http\Message\RequestInterface $request,\Psr\Http\Message\ResponseInterface|null $response = null,\Exception $error = null): string
Scrubs and formats a detailed message containing HTTP request and response, and errors if exist.
\Psr\Http\Message\RequestInterface | $request | the HTTP request |
\Psr\Http\Message\ResponseInterface|null | $response | the HTTP response |
\Exception | $error | the HTTP error |
the formatted detailed log message