networkteam/neos-sentryclient

Neos CMS 的 Sentry 客户端

4.2.1 2023-04-28 18:07 UTC

This package is auto-updated.

Last update: 2024-08-28 21:36:18 UTC


README

这是一个 Neos CMS (https://www.neos.io) 的 Sentry 客户端包。

它基于 https://github.com/getsentry/sentry-php

有关 Sentry 的更多信息,请访问 https://sentry.io

安装

$ composer require networkteam/neos-sentryclient

配置

将以下内容添加到您的 Settings.yaml 文件中,并将 dsn 设置替换为您的项目 DSN(Sentry 项目中的 API 密钥)

Networkteam:
  SentryClient:
    # The Sentry DSN
    dsn: 'http://public_key:secret_key@your-sentry-server.com/project-id'

您可以通过实现 \Networkteam\SentryClient\User\UserContextServiceInterface 来传递您自己的用户上下文信息到日志记录。如果您没有 TYPO3.Party 包且不想实现自己的 UserContextService,您需要在 Objects.yaml 中设置 \Networkteam\SentryClient\User\DummyUserContext,如下所示:

Networkteam\SentryClient\User\UserContextServiceInterface:
  className: Networkteam\SentryClient\User\DummyUserContext

这将防止收集任何用户信息,除非是通过 Flow SecurityContext 可用的信息。

使用方法

Sentry 会记录所有启用了渲染选项 logException 的异常。这可以通过根据 Flow 配置的状态码或异常类启用或禁用。

开发

此包由 GitHub 管理。欢迎您在 https://github.com/networkteam/Networkteam.Neos.SentryClient 上联系。

许可证

有关许可证权利和限制(MIT),请参阅 LICENSE 文件。