2017 © Pedro Peláez
 

library monolog-async-handler

Sends monolog notifications via given closure

image

lezhnev74/monolog-async-handler

Sends monolog notifications via given closure

  • Thursday, March 15, 2018
  • by lezhnev74
  • Repository
  • 1 Watchers
  • 4 Stars
  • 1,332 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 35 % Grown

The README.md

MonologAsyncHandler

Packagist Build Status Total Downloads, (*1)

Handler for monolog to handle log writing through closure. Inside the closure you can set pushing to queues., (*2)

Example usage

use lezhnev74\Monolog\Handler\ClosureHandler;
use Monolog\Logger;

$handler = new ClosureHandler(function ($record) {
    // put your data to queue
    // or any other logic goes here that detaches the logging from life circle

    /* 
    the $record contains:

    [
        "message"    => "the message goes here",
        "context"    => ["platform" => "ios"], // context
        "level"      => 200,
        "level_name" => "INFO",
        "channel"    => "local",
        "datetime"   => "",
        "extra"      => [],
        "formatted"  => "[2016-01-30 15:41:37] local.INFO: FORMATTED MESSAGE GOES HERE []\n",
    ]
    */
});
$monolog = new Logger('async_logger');
$monolog->pushHandler($handler);

Installation

composer require lezhnev74/monolog-async-handler

The Versions

15/03 2018

dev-master

9999999-dev

Sends monolog notifications via given closure

  Sources   Download

MIT

The Requires

 

The Development Requires

30/01 2016

1.0

1.0.0.0

Sends monolog notifications via given closure

  Sources   Download

MIT

The Requires

 

The Development Requires