andersundsehr/sentry-async

为 Symfony 的异步 Sentry - 燃烧并忘记

安装: 99

依赖项: 0

建议者: 0

安全: 0

星标: 1

关注者: 3

分支: 0

开放问题: 0

类型:symfony-bundle

1.0.0 2023-11-24 08:07 UTC

This package is auto-updated.

Last update: 2024-09-24 10:07:48 UTC


README

要启用异步传输,请配置 Sentry 使用我们的传输工厂。
此扩展包含默认的 file_queue,可以在 config/packages/sentry.yaml 中进行配置

sentry:
  transport_factory: AUS\SentryAsync\Transport\TransportFactory

sentry_async:
  file_queue:
    compress: true
    limit: 200
    directory: '%kernel.cache_dir%/sentry_async/'

实际上,您可以使用其他队列功能,并在 config/services.yaml 中自行处理

  App\Queue\ExampleQueue:
    public: true

  AUS\SentryAsync\Transport\TransportFactory:
    $queue: '@App\Queue\ExampleQueue'

src/Queue/ExampleQueue 中的另一个传输类示例

<?php

declare(strict_types=1);

namespace App\Queue;

use AUS\SentryAsync\Queue\Entry;
use AUS\SentryAsync\Queue\QueueInterface;

class ExampleQueue implements QueueInterface
{

    public function pop(): ?Entry
    {
    }

    public function push(Entry $entry): void
    {
    }
}