qlimix/logging-http-logger

Logging PSR-7 http requests

2.0.0 2020-11-21 19:51 UTC

This package is auto-updated.

Last update: 2024-11-22 05:11:58 UTC


README

Travis CI Coveralls Packagist MIT License

Logging PSR-7 http requests.

Install

Using Composer:

$ composer require qlimix/logging-http-logger

usage

Logging requests:

<?php

use Qlimix\Log\Logger\Request\PSRRequestLogger;

$logHandler = new FooBarLogHandler();

$requestLogger = new PSRRequestLogger($logHandler);

$requestLogger->log(new Request());

Logging responses:

<?php

use Qlimix\Log\Logger\Response\PSRResponseLogger;

$logHandler = new FooBarLogHandler();

$responseLogger = new PSRResponseLogger($logHandler);

$responseLogger->log(new Request());

Testing

To run all unit tests locally with PHPUnit:

$ vendor/bin/phpunit

Quality

To ensure code quality run grumphp which will run all tools:

$ vendor/bin/grumphp run

Contributing

Please see CONTRIBUTING for details.