pluswerk/sentry
最新稳定版本:3.4.0
Composer 安装命令:
composer require pluswerk/sentry
包简介
+Pluswerk TYPO3 extension: Sentry Client
README 文档
README
This extension is deprecated and will not be upgraded to TYPO3 13. ⛔
It is replaced by andersundsehr/sentry-bridge 😁.
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
- .
Pluswerk TYPO3 Sentry PHP Client
Features:
- has LogWriter that enables you to write any log entries into sentry
- Logs all exceptions caught by the TYPO3 error handling.
- Logs all exceptions that are caught by the TYPO3 ProductionExceptionHandler ContentObject.
- This handles the
Oops, an error occurred! code: 2023080912232477707e9berrors in your site. - It displays the error message as normal + a link with only a after the code. So a normal user will not see the link.
- The link directly opens the sentry with the correct error.
- This handles the
Quickstart:
- Add environment variables:
SENTRY_DSN=https://dsn-to-your@sentry.io/instanceSENTRY_ORGANISATION=sentry(optional) if the organisation of your sentry is different. is used in eg. the Oops, an error occurred! Code: 2023080912232477707e9bDISABLE_SENTRY(optional) Disable Sentry by setting this to 1SENTRY_QUEUE(optional) Enable queue system by setting this to 1SENTRY_ERRORS_TO_REPORT(optional) The Errors to Report as number, e.g. 4096 for E_REVOERABLE_ERROR
- Add the following line to your
AdditionalConfiguration.php(new \Pluswerk\Sentry\Bootstrap())->initializeHandler();
- If you enabled SENTRY_QUEUE
- Add
typo3 pluswerk:sentry:flushto your scheduling service - Add environment before the command if you want to report errors while running the command
SENTRY_QUEUE=0 typo3 pluswerk:sentry:flush
- Add
Settings
The Extension comes with a couple of settings in the TYPO3-Backend:
force_disable_sentry-> Forcefully override the ENV by disabling Sentry in backendenable_git_hash_releases(default yes) -> Automatically track releases with the current git hash (only works if git is installed)
Configuring the scope
Sometimes it might be necessary to additionally configure the scope of a sentry event.
For this, the method \Pluswerk\Sentry\Sentry::withScope($exception, $scopeCallback) comes in play.
The arguments are similar to https://docs.sentry.io/platforms/php/enriching-events/scopes/#local-scopes.
The first argument requires the exception to be thrown and the second is a callback,
for where you can apply custom settings to the Sentry Scope.
There is no need to additionally write captureException within that callback.
Example:
Sentry::getInstance()->withScope($exception, fn(Scope $scope) => $scope->setTag('oops_code', $oopsCode));
SentryLogger
You can write this in your additional.php if you want all warnings from the TYPO3 log to be logged in Sentry:
$GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'][LogLevel::WARNING] = [ SyslogWriter::class => [], SentryLogger::class => [], ];
pluswerk/sentry 适用场景与选型建议
pluswerk/sentry 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 22.23k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2019 年 04 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 pluswerk/sentry 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pluswerk/sentry 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 22.23k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2019-04-16