Problem with logging in a command

Hello,

I can’t make the logging work in my console application: nothing is logged. I’m using this Yii command:


Yii::trace("cannot init. item: $item->id", CLogger::LEVEL_WARNING, "application.commands.MyCommand");

and my config/console.php is contains a ‘log’ section:




...

'preload'=>array('log'),

...

'components'=>array(

    'log'=>array(

        'class'=>'CLogRouter',                                      

        'routes'=>array(

           array(                     

                'class'=>'CFileLogRoute',                   

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

                'categories'=>'system.*, application.commands.*',

            ),

  

        ),

     ),

  ),



What’s wrong ? Thank you,

Fabrice

Note that trace() has 2 parameters where the second is category not level - http://www.yiiframework.com/doc/api/1.1/YiiBase#trace-detail

log() has 3 parameters, where second is level and third category - http://www.yiiframework.com/doc/api/1.1/YiiBase#log-detail