2

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?

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

Comments

1

YII 2 it may be accomplished by:

foreach (\Yii::$app->log->targets as $target) {
    $target->setEnabled(false);
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.