yiisoft/yii-sentry 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yiisoft/yii-sentry

最新稳定版本:2.0.1

Composer 安装命令:

composer require yiisoft/yii-sentry

包简介

A Sentry integration for Yii Framework

README 文档

README

Yii Sentry

Yii Sentry


Latest Stable Version Total Downloads Build status Code coverage Mutation testing badge static analysis

The package provides Sentry integration for Yii Framework.

Requirements

  • PHP 8.1 - 8.4.

Installation

The package could be installed with Composer.

The package needs PSR-compatible HTTP client and factories so require it additionally to this package:

composer install httpsoft/http-message
composer install php-http/guzzle7-adapter
composer install yiisoft/yii-sentry

The first two can be replaced to other packages of your choice.

For handling console errors yii-console and yii-event packages are required additionally:

composer install yiisoft/yii-console
composer install yiisoft/yii-event

Add SentryMiddleware to main application middleware set and configure DSN in config/params.php. Console errors are captured by default, there is no need to configure anything.

return [
    // ...
    'middlewares' => [
        ErrorCatcher::class,
        SentryMiddleware::class, // <-- here
        SessionMiddleware::class,
        CookieMiddleware::class,
        CookieLoginMiddleware::class,
        LocaleMiddleware::class,
        Router::class,
    ],
    // ...
    'yiisoft/yii-sentry' => [
        'handleConsoleErrors' => false, // Add to disable console errors.
        'options' => [
            // Set to `null` to disable error sending (note that in case of web application errors it only prevents
            // sending them via HTTP). To disable interactions with Sentry SDK completely, remove middleware and the
            // rest of the config.
            'dsn' => $_ENV['SENTRY_DSN'] ?? null,
            'environment' => $_ENV['YII_ENV'] ?? null, // Add to separate "production" / "staging" environment errors.
        ],
    ],
    // ...
]

Note that fatal errors are handled too.

In options you can also pass additional Sentry configuration. See official Sentry docs for keys and values.

Documentation

If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.

License

The Yii Sentry is free software. It is released under the terms of the BSD License. Please see LICENSE for more information.

Maintained by Yii Software.

Support the project

Open Collective

Follow updates

Official website Twitter Telegram Facebook Slack

统计信息

  • 总下载量: 32.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 22
  • 点击次数: 1
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 22
  • Watchers: 15
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-05-30