A Guzzle middleware to log request and responses automatically
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
was parsed into an array in order to be better readable in the logger. This has changed to match a regular expression
/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. Therefore
it was added as a requirement to composer.json
sensitive
. When you make a request using guzzle you can set this option to true
in order not to log the body of the request and response. Example:$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 wording
"Body was truncated because of it's size". This is changed now and the summary
key is removed therefore the body
key will contain the summary from now on.body
.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.