Collection of PSR-3 LoggerInterface implementation.
Run through composer
$ composer require juhara/zzzlogger
TeeLogger
LoggerInterface implementation that duplicate log to two other loggers.ManyLogger
LoggerInterface implementation that duplicate log to many loggers.
Combine two different loggers as one logger. For example using Monolog to log to file and PHP Debug bar to log to html page.
<?php
$monolog = new Monolog\Logger\Logger();
$debugbar = new \DebugBar\StandardDebugBar();
...
$teeLogger = new \Juhara\ZzzLogger\TeeLogger($monolog, $debugbar['messages']);
$teeLogger->info('hello world');
$teeLogger->warning('world climate change warning');
Daisy chain loggers to combine more than two loggers as one logger.
<?php
$teeLogger1 = new \Juhara\ZzzLogger\TeeLogger($logger1, $logger2);
$teeLogger = new \Juhara\ZzzLogger\TeeLogger($teeLogger1, $logger3);
$teeLogger->info('hello world');
$teeLogger->warning('world climate change warning');
Combine many loggers as one logger.
<?php
$manyLogger = new \Juhara\ZzzLogger\ManyLogger([$logger1, $logger2, $logger3]);
$manyLogger->info('hello world');
$manyLogger->warning('world climate change warning');
If you have any improvement or issues please submit PR.
Thank you.