A Guzzle middleware to log request and responses automatically
MIT License
Bot releases are hidden (Show)
Published by gmponos over 2 years ago
Published by gmponos over 2 years ago
HandlerInterface::log
to allow Throwables. Now the signature isHandlerInterface::log(
LoggerInterface $logger,
RequestInterface $request,
?ResponseInterface $response = null,
?Throwable $exception = null,
?TransferStats $stats = null,
array $options = []
)
Published by gmponos almost 6 years ago
ThresholdStrategy
FixedStrategy
BREAKING CHANGES
LogLevelStrategy
class is removed and it has been separated to smaller classes.added
section below.GuzzleLogMiddleware
instead of Gmponos\GuzzleLogger
.HandlerInterface::log
.ArrayHandler
to MultiRecordArrayHandler
FixedStrategy
a strategy that you are able to set one level for all your logs.ThresholdLevelStrategy
a strategy that works with thresholds depending on the status code.StatusCodeStrategy
a strategy that you are able to set a specific log level per status code.Published by gmponos about 6 years ago
Published by gmponos about 6 years ago
LoggerAwareTrait
. Therefore the logger can not be set after the construction of the middleware.$logRequests
of the constructor to $logRequestOnExceptionOnly
.\Exception
or a MessageInterface
an Exception is thrown.__construct
and __invoke
to private. Same for the properties.application/json
the body/application\/[\w\.\+]*(json)/
in order to catch more cases. Thanks @eduarguzher #4
ext-json
needs to be installed in order for the package to work. Thereforecomposer.json
Published by gmponos over 6 years ago
sensitive
. When you make a request using guzzle you can set this option to true$guzzle->get('/test', ['log' => ['sensitive' => true]]);
^6.3
to 6.*
. Package should be able to work without constraints.summary
was added in the logs and also a key with body
. The body
contained the wordingsummary
key is removed therefore the body
body
.Published by gmponos over 6 years ago
I saw on packagist that this package lately has 2000 downloads.
Although they are not so many I thought that it deserves a release to be tagged if someone wants to lock on the current release.
I will soon make big changes to the package.