Yii log not working

I call Yii log with error level "Error" but it is not writing to the log files under the runtime directory. What should I do?

Hi Pota,

Is this a console application or a web application?

Is that directory writeable by the process that runs your web server?

Do you have a file log route configured in your config/main.php?


		'log'=>array(

			'class'=>'CLogRouter',

			'routes'=>array(

				array(

					'class'=>'CFileLogRoute',

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

				),

                

			),

		),



Also, I usually use all lower case for the log level: “error” instead of “Error” but I don’t know if that makes a difference.

Yep, the log directory is writable by the process that runs the web server, and I included the code you mentioned in the config main.php file.