ujamii / sentry-client
此包已被弃用且不再维护。未建议替代包。
Sentry Client for TYPO3
8.7.1
2019-02-26 07:28 UTC
Requires
- sentry/sentry: 1.10.*
- typo3/cms-core: ^8.7 || ^9.5
Replaces
- networkteam/sentry-client: 8.7.1
- sentry_client: 8.7.1
- typo3-ter/sentry-client: 8.7.1
README
这是一个较新版本的sentry客户端,因为我们的sentry服务器v9.0不再识别"release"标签,而是期望一个稍微不同的格式。
Sentry Client for TYPO3
使用sentry进行异常日志记录,见 http://www.getsentry.com
该扩展是 https://github.com/getsentry/sentry-php 的包装器
安装
$ composer require ujamii/sentry-client
它也可在TER中找到: http://typo3.org/extensions/repository/view/sentry_client
配置
在扩展管理器中设置dsn(http://public_key:secret_key@your-sentry-server.com/project-id),设置完成后即可。
功能切换
- 仅在生产环境中报告异常
- 当
$GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']
与客户端IP匹配时报告异常 - 忽略 PageNotFoundException 并触发 404 处理
- 报告用户信息:选择
none
|userid
|usernameandemail
之一 - 黑名单异常消息正则表达式
开发
您可以使用 $GLOBALS['USER']['sentryClient']
,它是一个 \Raven_Client 的实例,来添加您自己的标签或日志消息。
示例:添加自定义标签
$GLOBALS['USER']['sentryClient']->setRelease('201802072115');
如何测试与Sentry的连接?
导航到具有未配置页面类型(如)的可达页面:
http://your-typo3-site.de/index.php?id=1&type=1001
这将触发一个 ServiceUnavailableException,并将其报告。
改进/问题
此扩展由GitHub管理。请随时联系 https://github.com/networkteam/sentry_client
帮助
有一个Slack频道 #ext-sentry_client