Yii:log - some questions


I am try to use -

Yii::log(‘message’, CLogger::LEVEL_ERROR)

but it not working … runtime/application.log is empty.

I also noticed it only work when exception is occured.

Cant I use Yii::log for regular logging without exception raise?


Can you show us the log-stanza from your config? Sounds like logging isn’t configured properly.

Had similar problems with no log entries saved in files. My problem was that runtime folder hadn’t the correct permissions that the webserver process user was able to create/write the log file.

If you are on *NIX check the permissions!

check the log entry in your /protected/config/main.php if you log the errors. mine looks so:






			'levels'=>'error, warning, trace, info',




your sample code works fine for me

ok, this code is work fine:



					'levels'=>'error, warning, [b]mycustom[/b]',


Yii::log('>>>>>>>>>> hello', '[b]mycustom[/b]');

This code use custom ‘mycustom’ tag, through standalone CLogger const, and work fine.

I not shure, but in some cases while exceptions(not critical ofcourse) occured logging not work.

Thanks All for replies!!