Reputation: 1525
In general in development mode i have to use the debug and logging for bugtracing.
But on a specific controller/action i don't want this to happen since it's just a background ajax that gets called every 2 seconds, which ends ups in a huge amount of "unneeded" logs.
How can I exclude this specific call "site/ajaxupdate" from being logged?
Upvotes: 2
Views: 3727
Reputation: 9
YII 2 it may be accomplished by:
foreach (\Yii::$app->log->targets as $target) {
$target->setEnabled(false);
}
Upvotes: 1
Reputation: 25312
You could simply disable the corresponding log target in your controller, e.g. :
\Yii::$app->log->targets['file']->enabled = false;
Read more about toggling log targets.
Upvotes: 4