No route CHttpException


I have an application that route logs via email, with error and warning levels.

My issue is that I don’t want to receive the CHttpException (error 404, 403, etc) throw by Yii.

Is there a way to filter CHttpException to this route?


Not tested but maybe can work like this:

Create and install your own LogFilter and override the method filter().

class MyLogFilter extends CLogFilter {


  public function filter(&$logs)



            $mylogs = array()

              foreach($logs as $log) 



                //$log[2] should be the category 

                   if(strpos($log[2],'exception.CHttpException') === false)





             $logs = $mylogs;




'log' => [


    'routes' => [


            'class' => 'CFileLogRoute',

            'levels' => 'error, warning',

            'except' => 'exception.CHttpException.404',