Closed bilfeldt closed 3 years ago
This PR adds an extra $config parameter to HttpLoggerInterface, HttpLoggingFilterInterface and the two macros log and logWhen.
$config
HttpLoggerInterface
HttpLoggingFilterInterface
log
logWhen
The purpose of this PR is to make it possible to specify configuration on demand.
The default configuration is to log only request/responses with errors
// config/http-client-logger.php 'filtering' => [ 'always' => false, '2xx' => false, '3xx' => false, '4xx' => true, '5xx' => true ],
with this PR is now possible to log just one request/response to say a specific disk:
$config = [ 'filtering' => [ 'always' => true, ], 'log_to_disk' => [ 'enabled' => true, 'disk' => 'local', ], ]; Http::log([], $config)->get(....);
This PR adds an extra
$config
parameter toHttpLoggerInterface
,HttpLoggingFilterInterface
and the two macroslog
andlogWhen
.The purpose of this PR is to make it possible to specify configuration on demand.
Example
The default configuration is to log only request/responses with errors
with this PR is now possible to log just one request/response to say a specific disk: