zae/monolog-publish

A publisher handler for monolog

0.0.2 2015-05-14 17:57 UTC

This package is auto-updated.

Last update: 2024-12-10 09:47:14 UTC


README

Latest Version Software License Build Status Total Downloads

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.