#AccessLog (v0.0.*) Log PSR-7 http messages using a PSR-3 logger instance following apache2 access log format.
Install composer in your project:
curl -s http://getcomposer.org/installer | php
Create a composer.json file in your project root:
{
"require": {
"websoftwares/access-log": ~0.0.1"
}
}
Install via composer
php composer.phar install
Basic usage of the Websoftwares\AccessLog\Log
class.
use Websoftwares\AccessLog\LogFormatFactory;
use Websoftwares\AccessLog\Log;
// $logger instance of Psr\Log\LoggerInterface;
$format = (new LogFormatFactory)->commonLog();
$accessLog = new Log($logger, $format);
// $request instance of Psr\Http\Message\ServerRequestInterface
// $response instance of Psr\Http\Message\ResponseInterface
$accessLog($request, $response);
- v0.0.1: Initial import
In the tests folder u can find several tests.
The MIT License (MIT).