mouf/utils.log.psr.multi-logger

This package contains a PSR-3 compatible logger that wrap a set of loggers

v1.0.0 2016-04-07 14:15 UTC

This package is auto-updated.

Last update: 2024-03-15 03:51:39 UTC


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);