mouf / utils.log.psr.multi-logger
This package contains a PSR-3 compatible logger that wrap a set of loggers
Installs: 197 462
Dependents: 3
Suggesters: 0
Security: 0
Stars: 2
Watchers: 13
Forks: 1
Open Issues: 0
Type:mouf-library
Requires
- php: ^8.0
- psr/log: ^2.0 || ^3.0
README
This package contains a PSR-3 compliant composite logger class.
In practice, this class does not log anything but delegates logging to one or many PSR-3 compliant loggers. This is useful when you want to call multiple loggers at one.
Install
composer require mouf/utils.log.psr.multi-logger
Usage
Simply pass an array of loggers to the multi-logger:
$logger1 = new MyLogger(); $logger2 = new AnotherLogger(); $multiLogger = new Mouf\Utils\Log\Psr\MultiLogger([ $logger1, $logger2 ]);
You can also add loggers using the addLogger
method:
$logger1 = new MyLogger(); $logger2 = new AnotherLogger(); $multiLogger = new Mouf\Utils\Log\Psr\MultiLogger(); $multiLogger->addLogger($logger1); $multiLogger->addLogger($logger2);