https://github.com/thecodingmachine/utils.log.psr.multi-logger
This package contains a PSR-3 compatible logger that wrap a set of loggers
https://github.com/thecodingmachine/utils.log.psr.multi-logger
Last synced: 8 months ago
JSON representation
This package contains a PSR-3 compatible logger that wrap a set of loggers
- Host: GitHub
- URL: https://github.com/thecodingmachine/utils.log.psr.multi-logger
- Owner: thecodingmachine
- License: mit
- Created: 2014-04-03T14:05:25.000Z (almost 12 years ago)
- Default Branch: 1.0
- Last Pushed: 2024-07-25T12:34:08.000Z (over 1 year ago)
- Last Synced: 2025-04-10T06:41:00.004Z (10 months ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 2
- Watchers: 12
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
What is this package
====================
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
-------
```sh
composer require mouf/utils.log.psr.multi-logger
```
Usage
-----
Simply pass an array of loggers to the multi-logger:
```php
$logger1 = new MyLogger();
$logger2 = new AnotherLogger();
$multiLogger = new Mouf\Utils\Log\Psr\MultiLogger([ $logger1, $logger2 ]);
```
You can also add loggers using the `addLogger` method:
```php
$logger1 = new MyLogger();
$logger2 = new AnotherLogger();
$multiLogger = new Mouf\Utils\Log\Psr\MultiLogger();
$multiLogger->addLogger($logger1);
$multiLogger->addLogger($logger2);
```