Sentry service provider for the Silex framwork.

2.0.0 2016-08-20 08:47 UTC

This package is auto-updated.

Last update: 2020-06-25 10:23:16 UTC


Code Climate Test Coverage Total Downloads Latest Stable Version License

Sentry client service provider for the Silex framwork.

Install via composer

Add in your composer.json the require entry for this library.

    "require": {
        "moriony/silex-sentry-provider": "~2.0.0"

and run composer install (or update) to download all files.

If you don't need development libraries, use composer install --no-dev or composer update --no-dev


Service registration

$app->register(new Moriony\Silex\Provider\SentryServiceProvider, array(
    'sentry.options' => array(
        'dsn' => '',
        // ... and other sentry options

Here you can find other sentry options.

Exception capturing

$app->error(function (\Exception $e, $code) use($app) {
    // ...
    $client = $app['sentry'];
    // ...

Error handler registration

Yoc can install error handlers and shutdown function to catch fatal errors

// ...
$errorHandler = $app['sentry.error_handler'];
// ...