protected function onEndRequest()
    {
        Yii::getLogger()->flush();
        Yii::getLogger()->flush(true);
        Yii::$context->destory();
    }
protected function onEndRequest()
    {
        Yii::getLogger()->flush();
        Yii::getLogger()->flush(true);
        Yii::$context->destory();
    }
protected function onEndRequest ( ) { Yii :: getLogger ( ) -> flush ( ) ; Yii :: getLogger ( ) -> flush ( true ) ; Yii :: $ context -> destory ( ) ; }
To flush log
To destroy context
To flush log To destroy context