https://github.com/zamronypj/zzzlogger
PSR-3 LoggerInterface implementation collection
https://github.com/zamronypj/zzzlogger
log logger loggerinterface logging php php-library psr-3
Last synced: 4 months ago
JSON representation
PSR-3 LoggerInterface implementation collection
- Host: GitHub
- URL: https://github.com/zamronypj/zzzlogger
- Owner: zamronypj
- License: apache-2.0
- Created: 2018-08-26T04:36:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-30T03:22:32.000Z (over 7 years ago)
- Last Synced: 2025-07-05T05:40:35.165Z (11 months ago)
- Topics: log, logger, loggerinterface, logging, php, php-library, psr-3
- Language: PHP
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ZzzLogger
Collection of PSR-3 LoggerInterface implementation.
# Requirement
- [PHP >= 5.3](https://php.net)
- [PSR-3 LoggerInterface](https://www.php-fig.org/psr/psr-3/)
- [Composer](https://getcomposer.org)
# Installation
Run through composer
$ composer require juhara/zzzlogger
# Available LoggerInterface implementation
- `TeeLogger` [LoggerInterface][LoggerInterface] implementation that duplicate log
to two other loggers.
- `ManyLogger` [LoggerInterface][LoggerInterface] implementation that duplicate log
to many loggers.
# How to use
## TeeLogger class
Combine two different loggers as one logger. For example using [Monolog][Monolog] to log to file and [PHP Debug bar][Debugbar] to log to html page.
```
info('hello world');
$teeLogger->warning('world climate change warning');
```
Daisy chain loggers to combine more than two loggers as one logger.
```
info('hello world');
$teeLogger->warning('world climate change warning');
```
## ManyLogger class
Combine many loggers as one logger.
```
info('hello world');
$manyLogger->warning('world climate change warning');
```
# Contributing
If you have any improvement or issues please submit PR.
Thank you.
[LoggerInterface]:https://www.php-fig.org/psr/psr-3/#3-psrlogloggerinterface
[Monolog]:https://github.com/Seldaek/monolog
[Debugbar]:https://github.com/maximebf/php-debugbar