A Yii2 client for Sentry (https://getsentry.com)
Switch branches/tags
Nothing to show
Clone or download
Latest commit d191081 Oct 21, 2016
Permalink
Failed to load latest commit information.
src clearExtra method Oct 21, 2016
.gitignore 1.0 Dec 24, 2014
LICENSE 1.0 Dec 24, 2014
README.md Update README.md May 24, 2016
composer.json refactor abadoned package May 18, 2016

README.md

Yii2 sentry client

##Install

php composer.phar require e96/yii2-sentry

Usage

In config file:

'bootstrap' => ['log', 'raven'],
'components' => [
    'raven' => [
        'class' => 'e96\sentry\ErrorHandler',
        'dsn' => '', // Sentry DSN
    ],
    'log' => [
        'targets' => [
            [
                'class' => 'e96\sentry\Target',
                'levels' => ['error', 'warning'],
                'dsn' => '', // Sentry DSN
            ]
        ],
    ],
]

You can provide additional information with exceptions:

SentryHelper::extraData($task->attributes);
throw new Exception('unknown task type');

Or just capture message with full stacktrace

try {
    throw new Exception('FAIL');
} catch (Exception $e) {
    SentryHelper::captureWithMessage('Fail to save model', $e);
}