dkx / monolog-psr-http-request-processor
This package is abandoned and no longer maintained.
No replacement package was suggested.
Monolog processor for PSR HTTP request
1.0.0
2019-09-26 13:59 UTC
Requires
- php: >=7.3
- monolog/monolog: >=2.0
- psr/http-message: ^1.0
Requires (Dev)
- mockery/mockery: ^1.2
- phpstan/extension-installer: >=1.0
- phpstan/phpstan: >=0.11
- phpstan/phpstan-phpunit: >=0.11
- phpstan/phpstan-strict-rules: >=0.11
- phpunit/phpunit: >=8.0
This package is auto-updated.
Last update: 2024-01-26 23:17:20 UTC
README
Monolog processor for PSR Http requests
Installation
$ composer require dkx/monolog-psr-http-request-processor
Usage
<?php
use DKX\MonologPsrHttpRequestProcessor\HttpRequestProcessor;
use DKX\MonologPsrHttpRequestProcessor\HttpRequestProviderInterface;
use Monolog\Logger;
use Psr\Http\Message\ServerRequestInterface;
$requestProvider = new class implements HttpRequestProviderInterface
{
public function getRequest() : ?ServerRequestInterface
{
return get_current_http_request_somehow();
}
};
$logger = new Logger('default');
$logger->pushProcessor(new HttpRequestProcessor($requestProvider));