2017 © Pedro Peláez
 

library monolog-gitter-im

Sends monolog notifications through the gitter.im api to a targeted gitter chat room.

image

nackjicholson/monolog-gitter-im

Sends monolog notifications through the gitter.im api to a targeted gitter chat room.

  • Wednesday, October 29, 2014
  • by nackjicholson
  • Repository
  • 1 Watchers
  • 7 Stars
  • 77 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

monolog-gitter-im

Build Status, (*1)

Sends monolog notifications through the gitter.im api to a targeted gitter chat room., (*2)

screen shot 2014-10-25 at 1 02 42 pm, (*3)

Install

With composer:, (*4)

composer require "nackjicholson/monolog-gitter-im=1.x", (*5)

or in composer.json:, (*6)

"require": {
    "nackjicholson/monolog-gitter-im": "1.x"
}

Basic usage

// Default level is Logger::CRITICAL
$gitterHandler = new GitterImHandler('apiToken', 'roomId');

$logger = new Logger('gitterIm.example');
$logger->pushHandler($gitterHandler);

$logger->debug('debug will not go', ['ctx' => 'minutia']);
$logger->critical('A gitter.im critical monolog', ['ctx' => 'investigate']);
$logger->alert('A gitter.im alert monolog', ['ctx' => 'take action']);
$logger->emergency('A gitter.im emergency monolog', ['ctx' => 'boom!']);

This example will make separate requests to gitter api making one message for each of the monolog calls that are >= Logger::CRITICAL., (*7)

Wrap with BufferHandler

Wrapping the GitterImHandler with monolog's built in BufferHandler makes it possible for you to only make one buffered message per execution of your program. All logs which are to be sent to Gitter are buffered and then when the program exits, they are all sent to the chat room as one batched message., (*8)

Setup is straight-forward:, (*9)

$gitterHandler = new GitterImHandler('apiToken', 'roomId');
$bufferHandler = new BufferHandler($gitterHandler);

$logger = new Logger('gitterIm.buffered.example');
$logger->pushHandler($bufferHandler);

Author:
Will Vaughn
@nackjicholsonn
github:nackjicholson, (*10)

The Versions

29/10 2014

dev-master

9999999-dev

Sends monolog notifications through the gitter.im api to a targeted gitter chat room.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Will Vaughn

29/10 2014

v1.0.0

1.0.0.0

Sends monolog notifications through the gitter.im api to a targeted gitter chat room.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Will Vaughn