Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to see the log file in Yii

I am not able to see the log files in Yii framwork. By default it saves in "protected/runtime". Here is my config in main:

'log'=>array(
            'class'=>'CLoCFileLogRoutegRouter',
            'routes'=>array(
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'error, warning, info',
                    'categories'=>'system.*',
                ))),

and this is how I'm logging:

Yii::log("Index Checkout", "profile", 'system.web.CController');
Yii::trace('IndexCheckout', 'system.web.CController');

Not getting any error but can't find any log file.

Any idea ? Thanks.

like image 930
Arfeen Avatar asked Nov 22 '11 07:11

Arfeen


2 Answers

May be something wrong name with your log class CLoCFileLogRoutegRouter. It should be CLogRouter

'log' => array(
    'class' => 'CLogRouter',
        'routes' => array(
            array(
                'class' => 'CFileLogRoute',
                    'levels' => 'error, warning, info',
                    'categories'=>'system.*',
                ),
like image 141
aslingga Avatar answered Sep 22 '22 22:09

aslingga


Even though the question is already answered

Please consider that Yii writes logs after the main script is ended, So if you terminate your script using die() command, you never let Yii write it down. To avoid such problems you should terminate the script using Yii::app()->end() command.

For more information see here

like image 43
k__gc_im_o_ Avatar answered Sep 20 '22 22:09

k__gc_im_o_