Since you do not explicitly specify category in the log config, you should expect all categories to be logged, including your own "funny" category. But I recommend you first try with category omitted, then try a simpler version of your custom category. See the API reference for more details.
protected function afterSave() {
Yii::trace("Please help me!");
parent::afterSave();
}
The issue is the same. Really strange. Even with xdebug I can see that I am entering this method. I try to recreate this issue with a new project, maybe there is something wrong with the project itself. But I did not made really magic here.
I tried it in the tutorial example of the blog app. I added the trace in the afterSave method of the class Post:
protected function afterSave() {
parent::afterSave();
Yii::trace("Everything fine after afterSave()");
Tag::model()->updateFrequency($this->_oldTags, $this->tags);
}
Changing the original config to:
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
array(
'class'=>'CWebLogRoute',
'levels'=>'trace, error, warning',
),
// uncomment the following to show log messages on web pages
/*
array(
'class'=>'CWebLogRoute',
),
*/
),
),
Resulting in no trace entry of that call in the log. See attached file.
Maybe your controller action calls redirect() immediately after a successful save and CWebLogRoute shows the log for the new request (the page you redirected to)?
I use the demo blog app to ensure, that nothing fancy is creating this strange result.
Actually I found that the traces in CWebLogRoute is shorter than the trace with CFileLogRoute. I thought that bot components are swapable to providing the same result. It is not true, I found my message with the CFileLogRoute activated.
Is this a bug or a feature? What makes CWebLogRoute to show one trace msg and not another one?
it is really strange, after switching the Logger to CFileLogRouter I saw the traces of the calls of Yii::trace in the method afterSave(). But after a restart of the Apache the issues occurs again. If I call Yii::trace in the method afterSave() not trace is written into the log. When I raise an exception in place of the Yii::trace the exception is raised, so the method is called.
Just wanted to say I am having this same issue. Anyone know what is up? I did make sure my application.log is owned by Apache’s process (_www). I also tried chmod to 0666 but that didn’t help.