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

2.2.6 2022-11-28 11:09 UTC

This package is auto-updated.

Last update: 2023-02-28 11:42:34 UTC


README

GitHub License

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 1
    • SENTRY_QUEUE (optional) Enable queue system by setting this to 1
    • SENTRY_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

Settings

The Extension comes with a couple of settings in the TYPO3-Backend:

  • force_disable_sentry -> Forcefully override the ENV by disabling Sentry in backend
  • enable_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.