punktde/sentry-flow
Composer 安装命令:
composer require punktde/sentry-flow
包简介
Sends exceptions and additional data to Sentry server using Raven client.
README 文档
README
This is a Sentry client package for the Flow framework.
Have a look at https://sentry.io for more information about Sentry.
Installation
$ composer require punktde/sentry-flow
Compatibilty matrix
| Flow Sentry Client | Flow | Sentry SDK | Sentry Server |
|---|---|---|---|
| ^1.0 | ^4.0 | ^1.0 | * |
| ^2.0 | ^5.0 | ^1.0 | * |
| ^3.0 | ^5.0, ^6.0 | ^2.0 | * |
| ^4.0 | ^5.0 - ^8.0 | ^3.0 | >= v20.6.0 |
| ^5.0 | ^5.0 - ^9.0 | ^4.0 | >= v20.6.0 |
Configuration
Add the following to your Settings.yaml and replace the dsn setting with your project DSN (API Keys in your Sentry project):
PunktDe: Sentry: Flow: dsn: 'https://public_key@your-sentry-server.com/project-id'
You can also set the Sentry Environment to filter your exceptions by e.g. dev-/staging-/live-system.
Set the env variable SENTRY_ENVIRONMENT or add your value to your Settings.yaml:
PunktDe: Sentry: Flow: environment: 'live'
Furthermore you can set the Sentry Release version to help to identifiy with which release an error occurred the first time.
By default, a file which is starting with the name RELEASE_ is searched and the values after RELEASE_ is used for Sentry.
Alternatively you can override the filebased release number and set an environment variable SENTRY_RELEASE or add your value to your Settings.yaml:
PunktDe: Sentry: Flow: release: '5.0.3'
If you need to use a custom transport e.g. to write the sentry reports to a file, you must implement the Sentry\TransportInterface:
<?php declare(strict_types=1); namespace Vendor\Package\Sentry\Transport; use Sentry\Event; use Sentry\Exception\JsonException; use Sentry\Transport\TransportInterface; use Sentry\Util\JSON; class FileWriterTransport implements TransportInterface { /** * @param Event $event * * @return string|null Returns the ID of the event or `null` if it failed to be sent * * @throws JsonException */ public function send(Event $event): ?string { if (file_put_contents('My\Path\And\FileName', JSON::encode($event)) !== false) { return $event->getId(); } return null; } }
Then you configure the class to be used:
PunktDe: Sentry: Flow: transportClass: '\Vendor\Package\Sentry\Transport\FileWriterTransport'
Usage
Sentry will log all exceptions that have the rendering option logException enabled. This can be enabled or disabled
by status code or exception class according to the Flow configuration.
punktde/sentry-flow 适用场景与选型建议
punktde/sentry-flow 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 81.58k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2018 年 01 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 punktde/sentry-flow 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 punktde/sentry-flow 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 81.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-15