merophp / log-manager
Logger manager for the Merophp Framework
0.1-alpha
2021-12-22 10:54 UTC
Requires
- php: >=7.4
- psr/log: ^1.1.4
Requires (Dev)
- mockery/mockery: ^1.4
- phpunit/phpunit: ^9.5
README
Logger Manager for the Merophp Framework. The manager holds PSR-3-based named loggers, so you can easily connect logging libraries or custom loggers to the framework.
Installation
Via composer:
composer require merophp/log-manager
Basic Usage
use Merophp\LogManager\LogManager;
use Merophp\LogManager\namedLogger\AbstractNamedLogger;
require_once dirname(__DIR__).'/vendor/autoload.php';
class MyLogger extends AbstractNamedLogger
{
public function __construct(string $name)
{
$this->name = $name;
}
}
$logManager = new LogManager;
$logManager->addLogger(new MyLogger('security');
$logManager->warning('security', 'My message');
$logManager->getLogger('security')->warning('My message');