evolution7/silverstripe-bugsnag-logger

Bugsnag 错误报告集成插件 for Silverstripe

1.0.2 2013-11-17 23:29 UTC

This package is not auto-updated.

Last update: 2024-09-24 01:41:04 UTC


README

Silverstripe Bugsnag Logger 将您的错误通知发送到 Bugsnag

兼容性

经过测试,与 Silverstripe 2.4 和 3.x 应用程序兼容。

安装

推荐的方式是使用 Composer

将此存储库和原始 bugsnag 项目添加到项目的 composer.json 文件中

"require": {
    "evolution7/silverstripe-bugsnag-logger": "1.*"
}

之后只需运行

$ composer install

$ composer update evolution7/silverstripe-bugsnag-logger

作为子模块

如果您的项目不使用 Composer,您可以将存储库作为子模块导入。

$ git submodule add https://github.com/evolution7/silverstripe-bugsnag-logger bugsnag-logger
$ git submodule add https://github.com/bugsnag/bugsnag-php.git vendor/bugsnag
$ git submodule update --recursive --init

用法

安装后,您只需在 _config.php 中添加以下行即可启用 Bugsnag Logger。

E7_BugsnagLogger::enableWithApiKey(API-KEY-HERE);

高级用法

客户端配置

调用 enableWithApiKey 方法将返回来自官方 bugsnag-php 库的 Bugsnag_Client 对象。有关详细信息,请参阅他们的 Github 页面的文档。

发布阶段

Bugsnag 允许您确定您当前所在的发布阶段,Bugsnag Logger 使用一个 ReleaseStage 类来完成此操作,该类根据路径确定,但您可以通过在调用 enableWithApiKey 时提供自己的 ReleaseStage 类作为可选的第二个参数来覆盖此操作。此类必须实现 ReleaseStageInterface 以确保具有所需的方法。

E7_BugsnagLogger::enableWithApiKey(API-KEY-HERE, new CustomReleaseStage());

贡献

  • Github 上 fork 它
  • 进行您希望看到的更改
  • 发起 pull request
  • 谢谢!