satun14/yii2-sentry

为Sentry提供的Yii 2扩展

安装: 0

依赖者: 0

建议者: 0

安全: 0

星标: 0

关注者: 0

分支: 30

类型:yii2-extension

1.0.5 2024-09-13 14:10 UTC

This package is auto-updated.

Last update: 2024-09-13 14:13:12 UTC


README

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

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联系我们。