承接 friendsofhyperf/sentry 相关项目开发

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

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

friendsofhyperf/sentry

最新稳定版本:v3.2.0-beta.1

Composer 安装命令:

composer require friendsofhyperf/sentry

包简介

The sentry component for Hyperf.

README 文档

README

Latest Version Total Downloads GitHub license

The sentry component for Hyperf.

Installation

composer require friendsofhyperf/sentry

Publish

php bin/hyperf.php vendor:publish friendsofhyperf/sentry

Register Logger Handler

<?php

# use it send customer log to sentry
//\FriendsOfHyperf\Helpers\logs('project-name', 'sentry')->warning('this is a test warning issue!');

return [
    // ...
    'sentry' => [
        'handler' => [
            'class' => \FriendsOfHyperf\Sentry\Monolog\LogsHandler::class,
            'constructor' => [
                'group' => 'sentry',
                'level' => \Sentry\Logs\LogLevel::debug(),
                'bubble' => true,
            ],
        ],
        'formatter' => [
            'class' => \Monolog\Formatter\LineFormatter::class,
            'constructor' => [
                'format' => null,
                'dateFormat' => null,
                'allowInlineLineBreaks' => true,
            ]
        ],
    ],
    // ...
];

Sentry Running log

<?php

# config/autoload/sentry.php
return [
    // ...
    'logger' => Hyperf\Contract\StdoutLoggerInterface::class,
    // ...
];

Annotation

<?php
namespace App;

use FriendsOfHyperf\Sentry\Annotation\Breadcrumb;

class Foo
{
    #[Breadcrumb(category: 'foo')]
    public function bar($a = 1, $b = 2)
    {
        return __METHOD__;
    }
}

Tracing

SENTRY_TRACING_ENABLE_AMQP=true
SENTRY_TRACING_ENABLE_ASYNC_QUEUE=true
SENTRY_TRACING_ENABLE_COMMAND=true
SENTRY_TRACING_ENABLE_CRONTAB=true
SENTRY_TRACING_ENABLE_KAFKA=true
SENTRY_TRACING_ENABLE_MISSING_ROUTES=true
SENTRY_TRACING_ENABLE_REQUEST=true
SENTRY_TRACING_SPANS_COROUTINE=true
SENTRY_TRACING_SPANS_DB=true
SENTRY_TRACING_SPANS_ELASTICSEARCH=true
SENTRY_TRACING_SPANS_GUZZLE=true
SENTRY_TRACING_SPANS_RPC=true
SENTRY_TRACING_SPANS_REDIS=true
SENTRY_TRACING_SPANS_SQL_QUERIES=true

Sentry Develop Docs

Contact

License

MIT

统计信息

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

GitHub 信息

  • Stars: 18
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-28