zae / monolog-publish
A publisher handler for monolog
0.0.2
2015-05-14 17:57 UTC
Requires
- monolog/monolog: ~1.0
Requires (Dev)
- mockery/mockery: ~0.9
- phpunit/phpunit: ~4.0
- predis/predis: ~1.0
Suggests
- predis/predis: Needed to use the RedisPublisher
This package is auto-updated.
Last update: 2024-12-10 09:47:14 UTC
README
A simple Monolog handler that can be used to 'publish' the errors to a subscriber.
Publishers
Available publishers are:
- RedisPublisher
Install
Via Composer
$ composer require zae/monolog-publish
Usage
use Monolog\Logger; use Monolog\Handler\StreamHandler; use Zae\Monolog\Publish\Handler\PublishHandler; use Zae\Monolog\Publish\Publisher\RedisPublisher; // create a log channel $log = new Logger('name'); $log->pushHandler(new PublishHandler(new RedisPublisher('log', Logger::WARNING))); // add records to the log $log->addWarning('Foo'); $log->addError('Bar');
Testing
$ phpunit
Contributing
Contributions are welcome via pull requests on github.
Mostly new publishers are needed.
Credits
License
The MIT License (MIT). Please see License File for more information.