k1low/faultline 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

k1low/faultline

Composer 安装命令:

composer require k1low/faultline

包简介

faultline exception and error notifier for PHP

README 文档

README

faultline exception and error notifier for PHP.

Installation

$ composer require faultline/faultline

Usage

// Create new Notifier instance.
$notifier = new Faultline\Notifier([
    'project' => 'faultline-php',
    'apiKey' => 'xxxxXXXXXxXxXXxxXXXXXXXxxxxXXXXXX',
    'endpoint' => 'https://xxxxxxxxx.execute-api.ap-northeast-1.amazonaws.com/v0',
    'timeout' => '30.0',
    'notifications' => [
        [
            'type'=> 'slack',
            'endpoint'=> 'https://hooks.slack.com/services/XXXXXXXXXX/B2RAD9423/WC2uTs3MyGldZvieAtAA7gQq',
            'channel'=> '#random',
            'username'=> 'faultline-notify',
            'notifyInterval'=> 5,
            'threshold'=> 10,
            'timezone'=> 'Asia/Tokyo'
        ],
        [
            'type'=> 'github',
            'userToken'=> 'XXXXXXXxxxxXXXXXXxxxxxXXXXXXXXXX',
            'owner'=> 'k1LoW',
            'repo'=> 'faultline',
            'labels'=> [
                'faultline', 'bug'
            ],
            'if_exist'=> 'reopen-and-comment',
            'notifyInterval'=> 1,
            'threshold'=> 1,
            'timezone'=> 'Asia/Tokyo'
        ]
    ]
]);

// Set global notifier instance.
Faultline\Instance::set($notifier);

// Register error and exception handlers.
$handler = new Faultline\ErrorHandler($notifier);
$handler->register();

// Somewhere in the app...
try {
    throw new Exception('hello from faultline-php');
} catch(Exception $e) {
    Faultline\Instance::notify($e);
}

Monolog integration

$log = new Monolog\Logger('acl');
$log->pushHandler(new Faultline\MonologHandler($notifier));

$log->addError('permission denied', ['user_id' => 123]);

References

License

MIT © Ken'ichiro Oyama

统计信息

  • 总下载量: 6.92k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 4
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-12-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固