定制 nackjicholson/monolog-gitter-im 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nackjicholson/monolog-gitter-im

最新稳定版本:v1.0.0

Composer 安装命令:

composer require nackjicholson/monolog-gitter-im

包简介

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

README 文档

README

Build Status

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

screen shot 2014-10-25 at 1 02 42 pm

Install

With composer:

composer require "nackjicholson/monolog-gitter-im=1.x"

or in composer.json:

"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.

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.

Setup is straight-forward:

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

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

Author:
Will Vaughn
@nackjicholsonn
github:nackjicholson

统计信息

  • 总下载量: 92
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固