2017 © Pedro Peláez
 

library monolog-gearman-handler

Gearman Handler for Monolog logging library

image

vbelozyorov/monolog-gearman-handler

Gearman Handler for Monolog logging library

  • Monday, April 3, 2017
  • by vbelozyorov
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

monolog-gearman-handler

Monolog handler for sending logs to Gearman. May be usefull for async recording those logs on another machine., (*1)

Requirements

As you see from package name, this one is useless without Gearman PHP extension . Since Composer cannot install it, you need to do it yourself., (*2)

Install

composer require vbelozyorov/monolog-gearman-handler

This will install this package itself and, Monolog, if not yet installed., (*3)

Configure

Because handler constructor requires Gearman client, which in turn requires host and port of Gearman server, you need to be able to provide all this when logger will initialized., (*4)

Here is example for YAML config for Symfony2:, (*5)

services:
    gearman.client:
        class: GearmanClient
        calls:
            - [addServer, [%logs.gearman_host%, %logs.gearman_port%]]

    monolog.gearman_handler:
        class: Monolog\Handler\GearmanHandler
        arguments:
            - '@gearman.client'
        calls:
            - [setPrefix, ['project_alias']]

monolog:
    channels: [gearman]
    handlers:
        gearman:
            type:   service
            id:     monolog.gearman_handler
            level:  debug
            channels: [gearman]

        main:
            channels: ['!gearman']

In this example separate Monolog channell named gearman is registered. And handler main using in Symfony app by default excludes from this new channel. This way event logs like kernel.debug won't be published there., (*6)

How you get Gearman logger with this config:, (*7)

$logger = $this->getContainer()->get('monolog.logger.gearman');

The Versions

03/04 2017

dev-master

9999999-dev

Gearman Handler for Monolog logging library

  Sources   Download

MIT

The Requires

 

by Vladimir Belozyorov

log logging monolog asynchronous gearman

31/03 2017

v0.7

0.7.0.0

Gearman Handler for Monolog logging library

  Sources   Download

MIT

The Requires

 

by Vladimir Belozyorov

log logging monolog asynchronous gearman