diff --git a/RollbarErrorHandler.php b/RollbarErrorHandler.php index 21bd837..51c223b 100644 --- a/RollbarErrorHandler.php +++ b/RollbarErrorHandler.php @@ -7,7 +7,7 @@ class RollbarErrorHandler extends CErrorHandler { protected function handleException($exception) { - Rollbar::log(Level::error(), $exception); + Rollbar::log(Level::ERROR, $exception); parent::handleException($exception); } diff --git a/RollbarLogRoute.php b/RollbarLogRoute.php index c72ff88..bdcc2f0 100644 --- a/RollbarLogRoute.php +++ b/RollbarLogRoute.php @@ -1,17 +1,19 @@ getComponent($this->rollbarComponentName) === null) { throw new CException('Rollbar component is not loaded.'); } + $this->levelFactory = new LevelFactory(); } protected function processLogs($logs) @@ -19,7 +21,7 @@ protected function processLogs($logs) foreach ($logs as $log) { // Exclude records by the exceptions handler. RollbarErrorHandler takes care of them. if (strncmp($log[2], 'exception', 9) !== 0) { - Rollbar::log(Level::fromName($this->correspondingLevel($log[1])), $log[0]); + Rollbar::log($this->levelFactory->fromName($this->correspondingLevel($log[1])), $log[0]); } } } diff --git a/composer.json b/composer.json index 2e03ed5..787ca39 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,6 @@ ], "require": { "php": ">=5.3", - "rollbar/rollbar": "~1.1.0" + "rollbar/rollbar": "~1.3.1" } }