edr / http-logging-client
Logs to a PSR3-compliant logger when requests/responses are sent through an httplug HTTP client
dev-master
2016-08-25 09:22 UTC
Requires
- beberlei/assert: ^2.6
- php-http/httplug: ^1.0
- php-http/message: ^1.3
- php-middleware/log-http-messages: ^2.0
- psr/log: ^1.0
- zendframework/zend-diactoros: ^1.3.5
Requires (Dev)
- phpunit/phpunit: ^5.5
This package is not auto-updated.
Last update: 2025-01-18 21:03:05 UTC
README
An HTTPlug client that logs to a PSR3 logger.
This performs the same function as the HTTPlug plugin. This can be used as an alternative if you need more control of the logging options.
Example usage with Guzzle and Monolog:
$client = new \edr\LoggingHttpClient\LoggingHttpClient( new \Http\Adapter\Guzzle6\Client(new \GuzzleHttp\Client()), new \Monolog\Logger('debug', new \Monolog\Handler\StreamHandler('/tmp/debug.log')), new \edr\LoggingHttpClient\DiactorosFormatter() ); $client->sendRequest( ... );