comsolit/sentry_client
Composer 安装命令:
composer require comsolit/sentry_client
包简介
TYPO3 extension for PHP error and exception logging with Sentry, https://sentry.io
README 文档
README
A TYPO3 extension for PHP exception logging with Sentry, https://www.sentry.io
Logs frontend PHP errors and exceptions to your Sentry instance. Note that logging backend issues is not yet supported by TYPO3 (it's on the todo list for v9, according to core developer Markus Klein).
Based on the official Sentry PHP client,
sentry/sentry.
Installation
- Add something like this to your project's
composer.json, and runcomposer install:
"repositories": [ { "type": "composer", "url": "https://packagist.org/" }, { "url": "https://github.com/comsolit/sentry_client.git", "type": "git" } ], "require": { "comsolit/sentry_client": "dev-master" }
- Make sure your
typo3conf/LocalConfiguration.phpcontains something like this in theSYSsection:
'SYS' => [ // ... 'devIPmask' => '', 'displayErrors' => '0', 'enable_errorDLOG' => '1', 'enable_exceptionDLOG' => '1', 'enableDeprecationLog' => 'devlog', 'systemLog' => '', 'systemLogLevel' => '0', 'syslogErrorReporting' => E_ALL, 'belogErrorReporting' => E_ALL, 'exceptionalErrors' => E_RECOVERABLE_ERROR | E_USER_DEPRECATED, 'errorHandlerErrors' => E_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED, 'errorHandler' => 'SentryClient\\ErrorHandler', 'debugExceptionHandler' => 'SentryClient\\DebugExceptionHandler', 'productionExceptionHandler' => 'SentryClient\\ProductionExceptionHandler', ]
Alternatively, you can set those values
via the Install Tool or in typo3conf/AdditionalConfiguration.php.
Configuration
Set the Sentry DSN
(e.g. https://public_key:secret_key@your-sentry-server.com/project-id)
in the Extension Manager.
This will be added in your typo3conf/LocalConfiguration.php file at:
'EXT' => [ 'extConf' => [ 'sentry_client' => ...
NOTE: For professional deployments you should consider using something like
phpdotenv to manage your
secrets instead of using the Extension Manager, and leave your
LocalConfiguration under version control.
JavaScript Error Logging
For logging your JavaScript errors to Sentry see the JavaScript Sentry docs.
If you include your JavaScript sources via TypoScript it can be handy to avoid
hard-coding and define a SENTRY_DSN_PUBLIC value in your system environment
(e.g. via a .env file read by phpdotenv).
You can read the value in TypoScript using the getenv command
like this:
page.headerData {
999 = COA
999 {
10 = TEXT
10.value = <script src="https://cdn.ravenjs.com/3.16.0/raven.min.js" crossorigin="anonymous"></script>
20 = TEXT
20.value = <script>Raven.config('
30 = TEXT
30.data = getenv : SENTRY_DSN_PUBLIC
30.stdWrap.wrap = |
40 = TEXT
40.value = ', {release: '
50 = TEXT
50.data = getenv : PROJECT_VERSION
50.stdWrap.wrap = |
60 = TEXT
60.value = '}).install();</script>
}
}
Development
Your contributions are welcome! Please fork the repo, make your changes, and open a pull request.
comsolit/sentry_client 适用场景与选型建议
comsolit/sentry_client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.22k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 03 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 comsolit/sentry_client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 comsolit/sentry_client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2018-03-21