mito/yii2-sentry

Yii 2 的 Sentry 扩展

安装数: 351,800

依赖: 4

建议者: 0

安全: 0

星标: 93

关注者: 12

分支: 30

开放问题: 8

类型:yii2-extension

1.0.4 2017-11-28 16:52 UTC

This package is not auto-updated.

Last update: 2024-09-14 19:04:06 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 联系我们。