https://github.com/geo6/zend-expressive-sentry
Zend Expressive ErrorHandler able to send error to Sentry.io
https://github.com/geo6/zend-expressive-sentry
error-handler php sentry sentry-php zend-expressive
Last synced: about 1 month ago
JSON representation
Zend Expressive ErrorHandler able to send error to Sentry.io
- Host: GitHub
- URL: https://github.com/geo6/zend-expressive-sentry
- Owner: geo6
- License: gpl-3.0
- Created: 2019-08-19T15:54:56.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-08-20T14:59:48.000Z (almost 7 years ago)
- Last Synced: 2025-03-21T15:25:38.187Z (about 1 year ago)
- Topics: error-handler, php, sentry, sentry-php, zend-expressive
- Language: PHP
- Size: 39.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zend Expressive Sentry ErrorHandler
[](https://packagist.org/packages/geo6/zend-expressive-sentry)
[](https://packagist.org/packages/geo6/zend-expressive-sentry)
[](https://packagist.org/packages/geo6/zend-expressive-sentry)
[](LICENSE)
This library enables Zend Expressive to send errors and exceptions to [Sentry.io](https://sentry.io/).
## Install
```
composer require geo6/zend-expressive-sentry
```
## Configuration
Create a `sentry.global.php` file in your `config` directory with your correct DSN (and options, if necessary):
```php
[
'dsn' => 'https://xxxxx@sentry.io/12345',
],
];
```
## Usage
To enable it, you just have to add `Geo6\Expressive\Sentry\ConfigProvider::class` to your main configuration (usually `config/config.php`):
```diff
...
$aggregator = new ConfigAggregator([
+ Geo6\Expressive\Sentry\ConfigProvider::class,
...
], $cacheConfig['config_cache_path']);
...
```
The Sentry ErrorHandler will be active only in "production mode" (when `$config['debug]` is `false`).
To switch to "production mode", you can use `composer run development-disable`.
---
This library was inspired by [`stickeeuk/zend-expressive-sentry`](https://github.com/stickeeuk/zend-expressive-sentry).
The main difference is that this library uses the last version of the [PHP SDK](https://docs.sentry.io/clients/php/).