satun14/yii2-sentry
为Sentry提供的Yii 2扩展
1.0.5
2024-09-13 14:10 UTC
Requires
- bower-asset/raven-js: ~3.17
- sentry/sentry: *
- yiisoft/yii2: ~2.0.0
Requires (Dev)
- codeception/codeception: ~2.3
- codeception/mockery-module: ^0.2.2
- codeception/specify: *
- codeception/verify: *
- mito/yii2-coding-standards: ~2.0.0@beta
- satooshi/php-coveralls: ~1.0
- yiisoft/yii2-codeception: ~2.0
README
Sentry为Web应用提供实时崩溃报告,包括服务器和客户端。这是一个允许您将项目集成到Sentry并记录PHP和JavaScript错误的Yii 2扩展。
由Mito提供。
安装
推荐通过composer安装此扩展。
运行以下命令
php composer.phar require --prefer-dist mito/yii2-sentry "~1.0.0"
或者将以下行添加到您的composer.json
文件的require部分
"mito/yii2-sentry": "~1.0.0"
需求
Yii 2及以上版本。Sentry 8及以上版本。
您可以使用此扩展与Sentry的托管和本地版本一起使用。
用法
安装扩展后,在公共配置文件中设置您的配置
'components' => [ 'sentry' => [ 'class' => 'mito\sentry\Component', 'dsn' => 'YOUR-PRIVATE-DSN', // private DSN 'environment' => 'staging', // if not set, the default is `production` 'jsNotifier' => true, // to collect JS errors. Default value is `false` 'jsOptions' => [ // raven-js config parameter 'whitelistUrls' => [ // collect JS errors from these urls 'http://staging.my-product.com', 'https://my-product.com', ], ], ], 'log' => [ 'targets' => [ [ 'class' => 'mito\sentry\Target', 'levels' => ['error', 'warning'], 'except' => [ 'yii\web\HttpException:404', ], ], ], ], ],
要跳过开发环境中的错误收集,请使用此参数禁用组件
'components' => [ 'sentry' => [ 'enabled' => false, ], ],
许可证
代码在MIT许可证下发布。
联系
如果您有任何评论或问题,请通过info@mito.hu联系我们。