someblackmagic/yii2-sentry

为 Sentry 提供的 Yii 2 扩展

安装次数: 25

依赖者: 0

建议者: 0

安全性: 0

星标: 0

关注者: 1

分支: 30

类型:yii2-extension

1.0.5 2019-08-21 13:43 UTC

This package is auto-updated.

Last update: 2024-09-22 01:03:25 UTC


README

Sentry 提供了 Web 应用程序(包括服务器端和客户端)的实时崩溃报告。这是一个 Yii 2 扩展,允许您将项目集成到 Sentry 并记录 PHP 和 JavaScript 错误。

Mito 提供。

Latest Stable Version Total Downloads License

Build Status Coverage Status

安装

安装此扩展的首选方式是通过 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 联系我们。