Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arueckauer/mezzio-sentry-delegator
Mezzio Delegator and ErrorListener for Sentry
https://github.com/arueckauer/mezzio-sentry-delegator
mezzio sentry
Last synced: 2 months ago
JSON representation
Mezzio Delegator and ErrorListener for Sentry
- Host: GitHub
- URL: https://github.com/arueckauer/mezzio-sentry-delegator
- Owner: arueckauer
- License: bsd-3-clause
- Created: 2021-09-21T12:13:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-15T15:12:50.000Z (3 months ago)
- Last Synced: 2024-10-16T17:25:28.403Z (3 months ago)
- Topics: mezzio, sentry
- Language: PHP
- Homepage:
- Size: 60.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mezzio-sentry-delegator
Mezzio Delegator and ErrorListener for Sentry
This package provides an initialization wrapper for Sentry and the ability to capture Throwables in Sentry through an `ErrorListener` for the [Stratigility `ErrorHandler` middleware](https://docs.laminas.dev/laminas-stratigility/v3/error-handlers/#handling-php-errors-and-exceptions).
## Installation
Via Composer
```shell
composer require arueckauer/mezzio-sentry-delegator
```## Configuration
Provide a dsn for Sentry and possible other [configuration options](https://docs.sentry.io/platforms/php/configuration/) in the project's configuration, e.g. `config/autoload/services.local.php`. Go to the [PHP configure documentation](https://docs.sentry.io/platforms/php/#configure) to select the dsn for a project.
```php
[
'dsn' => 'https://@.ingest.sentry.io/',
],
];```
## Initialize Sentry
To initialize Sentry, add the following line to the anonymous function in `public/index.php`.
```php
(new MezzioSentryDelegator\SentryInitializer())($container);
```## Attach Listener by wiring delegator
Declare the delegator dependency in the project's configuration, e.g. `config/autoload/dependencies.global.php`.
```php
[
'delegators' => [
ErrorHandler::class => [
Delegator::class,
],
],
],
];
}
}```