Crash when in 'production mode'


Using 1.0.8 I noticed that when I turn off debugging output by removing the line from index.php

// remove the following line when in production mode

defined('YII_DEBUG') or define('YII_DEBUG',true);

I get this error

PHP Fatal error:  Class 'CLogger' not found in /usr/local/lib/yii-1.0.8.r1317/framework/base/CApplication.php on line 576

With debugging turned on, everything works with no messages.

Confused :)



Have you customized your ‘log’ application component?

No, in this regard the app is still plain yiic. Config has the preload for the log and only standard routes.

May I ask you to explicitly import system.logging.CLogger at the top of your application configuration in production mode?

Yii::import('system.logging.CLogger', true);

I haven’t faced such problem before. As long as Yii’s built-in autoload works, it should take care of unknown classes.

It may be also interesting to note that CLogger is invoked during error handling. If the previous snippet doesn’t make any difference, then try to dump $log right before line 576 in CApplication to see what’s going on.

Hi pestaa,

thanks for your suggestions, which I tried. Meanwhile I found out that all the other controllers work fine, only one has this actual problem. I was searching the files for this one for any extra chars and boms or anything, but no luck yet. I let the import function error_log the aliases for each call, but it did not lead to anything.

I will give it another try tomorrow - lucky that it works in debug mode, so they wont make me stay up all night :))



Hi all,

just to close this off. I upgraded to 1.0.9 a few days ago and noticed this was gone.