Greetings,
I’ve inherited code that silently handles exceptions (see below). I have logging on and uncaught errors are logged to app.log. Is there a way to log Exceptions to configured logger w.o having to find every catch statement?
Thanks!
try {
throw new Exception('TEST Exception');
} catch (Exception $e) {
//do nothing
}
You can to use
use yii\base\ErrorException; try { // ..... } catch (ErrorException $e) { \Yii::error("my custom message :".$e ,'customfile'); }