seeren / log
Log message and determine level
3.0.0
2022-01-06 15:05 UTC
Requires
- php: >=8.0.1
- psr/log: ^2.0
Requires (Dev)
- php-coveralls/php-coveralls: ^v2.5.2
- phpunit/phpunit: ^9.5
README
Log message with time scale for standard levels
Installation
Seeren\Log is a PSR-3 logger interfaces implementation
composer require seeren/log
Seeren\Log\Logger\Daily
Log message in a Daily
, Monthly
or Yearly
generated file with optional data slug
use Seeren\Log\Logger\Daily; $logger = new Daily();
By default, log folder is in /var/log
project/ └─ var/ └─ log/
Project directory can be specified at construction
use Seeren\Log\Logger\Daily; $logger = new Daily('..');
Log using levels
use Seeren\Log\Logger\Daily; $logger = new Daily(); $logger->log('info', 'Bob is logged');
Pass slug and context optionnaly
use Seeren\Log\Logger\Daily; $logger = new Daily(); $logger->log('error', 'Something happen: {message}', [ 'message' => 'Dummy message' ]);
License
This project is licensed under the MIT License