demi/yii1-bugsnag Yii1 bugsnag error handler

loggererrorphpyii1handlerbugsnag

yii1-bugsnag

Yii1 bugsnag error handler

Installation

Run

composer require "demi/yii1-bugsnag" "~1.0"

Configuration

/protected/config/main.php:

<?php

return [
    'components' => [
        'bugsnag' => [
            'class' => '\demi\bugsnag\yii1\BugsnagComponent',
            'bugsnagApiKey' => '<YOU API KEY>',
            'notifyReleaseStages' => ['production', 'development'],
            'projectRoot' => realpath(__DIR__ . '/../..'),
        ],
        'log' => [
            'class' => 'CLogRouter',
            'routes' => [
                [
                    'class' => '\demi\bugsnag\yii1\BugsnagLogRoute',
                    'levels' => 'error, warning',
                ],
            ],
        ],
    ],
];

/protected/config/console.php:

<?php

$mainConfig = require(dirname(__FILE__) . '/main.php');
return [
    'components' => [
        'errorHandler' => [
            'class' => '\demi\bugsnag\yii1\BugsnagErrorHandler',
        ],
        'bugsnag' => $mainConfig['components']['bugsnag'],
        'log' => [
            'class' => 'CLogRouter',
            'routes' => [
                [
                    'class' => '\demi\bugsnag\yii1\BugsnagLogRoute',
                    'levels' => 'error, warning',
                ],
            ],
        ]
    ],
];

Examples

<?php

// log exception
Yii::app()->bugsnag->notifyException(\Exception $e);
// log message
Yii::app()->bugsnag->notifyError('TestErrorName', 'Example warning message!', ['foo' => 'bar'], 'warning');

// or native exception
throw \Exception('Example exception message');
// or native log message
Yii::log('Example warning message!', 'warning', 'application.error');

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.7 is the latest of 8 releases



GPL-3.0-or-later license
Stats
0 github stars & 3 github forks
4 downloads in the last day
65 downloads in the last 30 days
6526 total downloads