websoftwares / access-log
Log PSR-7 http messages using a PSR-3 logger instance following apache2 access log format.
0.0.1
2015-05-25 09:02 UTC
Requires
- php: >=5.5.0
- psr/http-message: 1.0.0
- psr/log: ~1.0.0
Requires (Dev)
- phpunit/phpunit: dev-master
- satooshi/php-coveralls: dev-master
- zendframework/zend-diactoros: 1.0.0
This package is auto-updated.
Last update: 2024-12-15 04:35:59 UTC
README
#AccessLog (v0.0.*) Log PSR-7 http messages using a PSR-3 logger instance following apache2 access log format.
Installing via Composer (recommended)
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
Usage
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);
Changelog
- v0.0.1: Initial import
Testing
In the tests folder u can find several tests.
License
The MIT License (MIT).