pluswerk / sentry
+Pluswerk TYPO3 extension: Sentry Client
Installs: 8 572
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 3
Forks: 0
Open Issues: 2
Type:typo3-cms-extension
Requires
- php: ~7.4 || ~8.0 || ~8.1
- composer-runtime-api: ^2
- ext-fileinfo: *
- http-interop/http-factory-guzzle: ^1.0
- sentry/sentry: ^3.0
- typo3/cms-core: ^10.4 || ^11.5
Requires (Dev)
- phpstan/extension-installer: ^1.2
- pluswerk/grumphp-config: ^5.0
- saschaegerer/phpstan-typo3: ^1.8
- symfony/http-client: ^5.4
This package is auto-updated.
Last update: 2023-02-28 11:42:34 UTC
README
Pluswerk TYPO3 Sentry PHP Client
Quickstart:
- Add environment variables:
SENTRY_DSN=https://dsn-to-your@sentry.io/instance
DISABLE_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:flush
to 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.