定制 arueckauer/mezzio-sentry-delegator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

arueckauer/mezzio-sentry-delegator

最新稳定版本:3.0.0

Composer 安装命令:

composer require arueckauer/mezzio-sentry-delegator

包简介

Mezzio Delegator and ErrorListener for Sentry

README 文档

README

Mezzio Delegator and ErrorListener for Sentry

This package provides an initialization wrapper for Sentry and the ability to capture Throwables in Sentry through an ErrorListener for the Stratigility ErrorHandler middleware.

Installation

Via Composer

composer require arueckauer/mezzio-sentry-delegator

Configuration

Provide a dsn for Sentry and possible other configuration options in the project's configuration, e.g. config/autoload/services.local.php. Go to the PHP configure documentation to select the dsn for a project.

<?php

declare(strict_types = 1);

use Sentry\Options as SentryOptions;

return [
    // [..]
    SentryOptions::class => [
        'dsn' => 'https://<key>@<account-id>.ingest.sentry.io/<project-id>',
    ],
];

Initialize Sentry

To initialize Sentry, add the following line to the anonymous function in public/index.php.

(new MezzioSentryDelegator\SentryInitializer())($container);

Attach Listener by wiring delegator

Declare the delegator dependency in the project's configuration, e.g. config/autoload/dependencies.global.php.

<?php

declare(strict_types = 1);

use MezzioSentryDelegator\Delegator;
use Laminas\Stratigility\Middleware\ErrorHandler;

class ConfigProvider
{
    public function __invoke() : array
    {
        return [
            'dependencies' => [
                'delegators' => [
                    ErrorHandler::class => [
                        Delegator::class,
                    ],
                ],
            ],
        ];
    }
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2021-09-21