gold/craft-bugsnag
Composer 安装命令:
composer require gold/craft-bugsnag
包简介
Unofficial Bugsnag notifier for Craft Cms.
README 文档
README
This is basically a fork of the official Bugsnag Laravel Package. Thanks for the good work and I hope you guys don't mind :)
The Bugsnag Notifier for the excellent Craft CMS
gives you instant notification of errors and exceptions. Once installed,
the plugin will listen to the Yii Events onError and onException as
recommended by brand.
Bugsnag captures errors in real-time from your web, mobile and desktop applications, helping you to understand and resolve them as fast as possible. Create a free account to start capturing errors from your applications.
Installation
- Download this repo
- Rename the folder to
bugsnagand place it into your Craft CMS Plugin directory (craft/plugins) - In the newly created
craft/plugins/bugsnagdirectory runcomposer install - Navigate to your plugins page
/settings/pluginsand click Install - Make sure to configure the plugin as described in the next section
Configuration
-
Create a file
craft/config/bugsnag.phpthat contains your API key: -
Configure your
api_key:<?php # craft/config/bugsnag.php return array( 'api_key' => 'YOUR-API-KEY-HERE' );
-
Optionally, you can add the
notify_release_stageskey to the same file above to define which Craft environments will send Exceptions to Bugsnag.return array( 'api_key' => 'YOUR-API-KEY-HERE', 'notify_release_stages' => ['production', 'staging'] );
Hooks
discardBugsnagExceptionEvent($event)
Give plugins a chance to discard certain types of exceptions, such as a 404.
/**
* Stop an exception event from being reported to bugsnag
*
* @param CExeptionEvent $event
* @return boolean
*/
function discardBugsnagExceptionEvent($event)
{
$exception = $event->exception;
if (/* $exception should be discarded */){
return true;
}
}
Other
You can always grab the bugsnag instance from the bugsnag service to send your own errors and exceptions or register a beforeNotifyFunction.
craft()->bugsnag->instance()->notifyError("ErrorType", "Something bad happened here too");
See the Additional Configuration
documentation on the bugsnag-php library for more information.
gold/craft-bugsnag 适用场景与选型建议
gold/craft-bugsnag 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14.27k 次下载、GitHub Stars 达 12, 最近一次更新时间为 2015 年 07 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 gold/craft-bugsnag 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gold/craft-bugsnag 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 14.27k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-07-17