Unable to disabled log component in yii2.0 REST api


(Shishir Mudliyar) #1

I am trying to disabled logging in rest api and trying this command

Yii::$app->log->targets[‘file’]->enabled = false;

but its not disabled logging, still i can see the log entry added whenever any error/warning comes to the rest api.

config setting


‘log’ => [

    'traceLevel' => YII_DEBUG ? 3 : 0,


	    'targets' => [


			    'file'=>[


				'class' => 'yii\log\FileTarget',


				'levels' => ['error', 'warning'],


				'logVars' => [ '_FILES'],


				],


			],


	],