承接 rossaddison/yii-sentry 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

rossaddison/yii-sentry

Composer 安装命令:

composer require rossaddison/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.3 or higher.

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

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2025-06-23