2017 © Pedro Peláez
 

library log-http-messages

PSR-15 middleware for log PSR-7 HTTP messages using PSR-3 logger

image

php-middleware/log-http-messages

PSR-15 middleware for log PSR-7 HTTP messages using PSR-3 logger

  • Thursday, May 11, 2017
  • by snapshotpl
  • Repository
  • 1 Watchers
  • 4 Stars
  • 2,357 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 10 Versions
  • 6 % Grown

The README.md

log-http-messages middleware Build Status

PSR-15 middleware for log PSR-7 HTTP messages using PSR-3 logger, (*1)

This middleware provide framework-agnostic possibility to log request and response messages to PSR-3 logger., (*2)

Installation

composer require php-middleware/log-http-messages

To log http messages you need pass into LogRequestMiddleware implementation of PhpMiddleware\LogHttpMessages\Formatter\ServerRequestFormatter, PhpMiddleware\LogHttpMessages\Formatter\ResponseFormatter, instance Psr\Log\LoggerInterface and add this middleware to your middleware runner. You can also set log level (Psr\Log\LogLevel::INFO as default) and log message (Request/Response as default)., (*3)

Provided implementation of formatters:, (*4)

  • PhpMiddleware\LogHttpMessages\Formatter\EmptyMessageFormatter,
  • PhpMiddleware\LogHttpMessages\Formatter\ZendDiactorosToArrayMessageFormatter,
  • PhpMiddleware\LogHttpMessages\Formatter\ZendDiactorosToStringMessageFormatter.
$formatter = PhpMiddleware\LogHttpMessages\Formatter\ZendDiactorosToArrayMessageFormatter();
$logMiddleware = new PhpMiddleware\LogHttpMessages\LogMiddleware($formatter, $formatter, $logger);

$app = new MiddlewareRunner();
$app->add($logMiddleware);
$app->run($request, $response);

It's just works with any modern php framework and logger!

Middleware tested on: * Expressive * monolog, (*5)

Middleware should works with: * Slim 3.x * zend-log 2.6, (*6)

And any other modern framework supported PSR-15 middlewares and PSR-7 and PSR-3 implementation logger., (*7)

The Versions

11/05 2017

dev-master

9999999-dev

PSR-15 middleware for log PSR-7 HTTP messages using PSR-3 logger

  Sources   Download

The Requires

 

The Development Requires

debug logger middleware psr psr-7 log psr-3 psr-15

11/05 2017

3.0.2

3.0.2.0

PSR-15 middleware for log PSR-7 HTTP messages using PSR-3 logger

  Sources   Download

The Requires

 

The Development Requires

debug logger middleware psr psr-7 log psr-3 psr-15

11/05 2017

dev-use-compatibility-tool

dev-use-compatibility-tool

PSR-15 middleware for log PSR-7 HTTP messages using PSR-3 logger

  Sources   Download

The Requires

 

The Development Requires

debug logger middleware psr psr-7 log psr-3 psr-15

30/04 2017

3.0.1

3.0.1.0

PSR-15 middleware for log PSR-7 HTTP messages using PSR-3 logger

  Sources   Download

The Requires

 

The Development Requires

debug logger middleware psr psr-7 log psr-3 psr-15

30/04 2017

v3.x-dev

3.9999999.9999999.9999999-dev

PSR-15 middleware for log PSR-7 HTTP messages using PSR-3 logger

  Sources   Download

The Requires

 

The Development Requires

debug logger middleware psr psr-7 log psr-3 psr-15

30/04 2017

3.0

3.0.0.0

PSR-15 middleware for log PSR-7 HTTP messages using PSR-3 logger

  Sources   Download

The Requires

 

The Development Requires

debug logger middleware psr psr-7 log psr-3 psr-15

29/04 2017

dev-psr-15

dev-psr-15

PSR-15 middleware for log PSR-7 HTTP messages using PSR-3 logger

  Sources   Download

The Requires

 

The Development Requires

debug logger middleware psr psr-7 log psr-3 psr-15

29/04 2017

2.1.0

2.1.0.0

PSR-15 middleware for log PSR-7 HTTP messages using PSR-3 logger

  Sources   Download

The Requires

 

The Development Requires

debug logger middleware psr psr-7 log psr-3 psr-15

10/11 2015

2.0.0

2.0.0.0

Request and response middleware logger with PSR-7 and PSR-3

  Sources   Download

The Requires

 

The Development Requires

debug logger middleware psr psr-7 log psr-3

31/08 2015

1.0.0

1.0.0.0

Request and response middleware logger with PSR-7 and PSR-3

  Sources   Download

The Requires

 

The Development Requires

debug logger middleware psr psr-7 log psr-3