mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Сконфигурировано логирование приложения
This commit is contained in:
@ -3,6 +3,7 @@ namespace api\components;
|
||||
|
||||
use api\modules\authserver\exceptions\AuthserverException;
|
||||
use api\modules\session\exceptions\SessionServerException;
|
||||
use Yii;
|
||||
|
||||
class ErrorHandler extends \yii\web\ErrorHandler {
|
||||
|
||||
@ -17,4 +18,14 @@ class ErrorHandler extends \yii\web\ErrorHandler {
|
||||
return parent::convertExceptionToArray($exception);
|
||||
}
|
||||
|
||||
public function logException($exception) {
|
||||
if ($exception instanceof AuthserverException) {
|
||||
Yii::error($exception, AuthserverException::class . ':' . $exception->getName());
|
||||
} elseif ($exception instanceof SessionServerException) {
|
||||
Yii::error($exception, SessionServerException::class . ':' . $exception->getName());
|
||||
} else {
|
||||
parent::logException($exception);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user