Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/websoftwares/accesslog
Log PSR-7 http messages using a PSR-3 logger instance following apache2 access log format.
https://github.com/websoftwares/accesslog
Last synced: about 1 month ago
JSON representation
Log PSR-7 http messages using a PSR-3 logger instance following apache2 access log format.
- Host: GitHub
- URL: https://github.com/websoftwares/accesslog
- Owner: websoftwares
- License: mit
- Created: 2015-05-25T08:54:23.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-25T14:43:36.000Z (over 9 years ago)
- Last Synced: 2024-10-12T13:18:19.729Z (4 months ago)
- Language: PHP
- Size: 125 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
#AccessLog (v0.0.*)
Log [PSR-7](http://www.php-fig.org/psr/psr-7/) http messages using a [PSR-3](http://www.php-fig.org/psr/psr-3/) logger instance following [apache2 access log](https://httpd.apache.org/docs/2.4/logs.html#accesslog) format.[![Build Status](https://api.travis-ci.org/websoftwares/accessLog.png)](https://travis-ci.org/websoftwares/accessLog)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/websoftwares/accessLog/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/websoftwares/accessLog/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/websoftwares/accessLog/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/websoftwares/accessLog/?branch=master)## 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:
```php
{
"require": {
"websoftwares/access-log": ~0.0.1"
}
}
```Install via composer
```
php composer.phar install
```## Usage
Basic usage of the `Websoftwares\AccessLog\Log` class.```php
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](http://opensource.org/licenses/MIT "MIT") License (MIT).