nackjicholson/monolog-gitter-im
Composer 安装命令:
composer require nackjicholson/monolog-gitter-im
包简介
Sends monolog notifications through the gitter.im api to a targeted gitter chat room.
README 文档
README
Sends monolog notifications through the gitter.im api to a targeted gitter chat room.
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
nackjicholson/monolog-gitter-im 适用场景与选型建议
nackjicholson/monolog-gitter-im 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 92 次下载、GitHub Stars 达 6, 最近一次更新时间为 2014 年 10 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 nackjicholson/monolog-gitter-im 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 nackjicholson/monolog-gitter-im 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 92
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-10-25
