离线 / oc-sentry-plugin
October CMS 的 Sentry 集成
v3.0.3
2024-03-04 07:11 UTC
Requires
- php: ^7.2|^8.0
- composer/installers: ~1.0
- sentry/sentry-laravel: ^3.7.0
README
October CMS 的 Sentry 集成
设置
只需将您的 Sentry DSN 添加到您的 .env 文件
SENTRY_LARAVEL_DSN=https://your@dsn.ingest.sentry.io/12345678
配置
要配置此插件,创建一个 config/sentry.php 文件,并根据 Sentry 文档 添加所需的配置。
捕获自定义消息
使用以下语法将自定义消息发送到您的 Sentry 日志。
\Sentry\withScope(function (\Sentry\State\Scope $scope): void { $scope->setExtras([ 'custom' => 'value' ]); \Sentry\captureMessage('Something happened!'); });
从 2.x 升级到 3.x
在 3.0 版本中,此插件被大大简化。您现在可以通过 config/sentry.php 文件指定您的设置。旧的设置页面不再可用。
要升级到这个新版本,您必须将您的 Sentry DSN 添加到您的 .env 文件
SENTRY_LARAVEL_DSN=https://your@dsn.ingest.sentry.io/12345678