Log To Multiple Files?

I’m using Yii 1.1.12, logging is enabled using the default configuration as per config/main.php.


		'log'=>array(

			'class'=>'CLogRouter',

			'routes'=>array(

				array(

					'class'=>'CFileLogRoute',

					'levels'=>'error, warning',

				),

				// uncomment the following to show log messages on web pages

				array(

					'class'=>'CWebLogRoute',

				),

			),



Is there a way to configure for multiple file loggers, so for example trace and info level items are logged to one file trace.log, while warning and error level items are logged to a different file error.log?

Thanks

You can just add different arrays for different levels and specifying different files. See the example:




                                array(

                                        'class'=>'CFileLogRoute',

                                        'levels'=>'error, warning',

                                        'logFile' => 'error.log',

                                ),

                                array(

                                        'class'=>'CFileLogRoute',

                                        'levels'=>'trace',

                                        'logFile' => 'trace.log',

                                ),



Great, works perfectly.