1

how come this configuration doesn't log any errors at all inside my log folder

'log' => array(
    'class' => 'CLogRouter',
    'routes' => array(
        array(
            'class'=>'CFileLogRoute',
            'levels'=>'error, warning, info',
            'categories'=>'system.*',
            'logPath'=> '/export/home/sasori/branch/logs/',
            'logFile'=>'error.log',
        ),
         array(
             'class'=>'CWebLogRoute',
             'levels'=>'info',
             //'categories'=>'application.*',
            'showInFireBug'=>true
         ),
    ),

OR THIS

'log' => array(
    'class' => 'CLogRouter',
    'routes' => array(
        array(
            'class'=>'CFileLogRoute',
            'levels'=>'error, warning, info',
            'categories'=>'system.*',//'application.*',
            'logPath'=> '/export/home/sasori/branch/logs/',
            'logFile'=>'error.log',
        )
    ),

I also changed the error.log file's permission to 0777 ,but it didn't help at all

3 Answers 3

1

There are hardly calls to Yii::log() in Yii's core. Most are Yii::trace() which you'll only see if you have set YII_DEBUG true and add log level trace.

Sign up to request clarification or add additional context in comments.

1 Comment

Not sure what you mean. It's still the case in current Yii 1.1.13.
0

I also confuse about the Yii log system. In my project, logs are seperated by categories and will be kept in corresponding folders. But log system not works fine. Sometime yii wouldn't wrote log, and sometimes log config will cause an error saying 'unvalid path...'

'log'=>array(
        'class'=>'CLogRouter',
        'routes'=>array(
            array(
                'class'=>'CFileLogRoute',
                'levels'=>'error, warning, info',
                'categories'=>'application',
            ),
            //where problem occures
            array(
                'class'=>'CFileLogRoute',
                'levels'=>'error, warning, info',
                'logFile' => date('Ymd').'.log',
                //'logPath' => '../../logs/se',
                'logPath' => 'logs/se',
                'categories' => 'se.*',
            )
        ),
    ),

Any one has any idea about why?

Comments

0

If you set the 'categories' as array with categories, maybe it will helped

array(
        'class'=>'CFileLogRoute',
        'levels'=>'error, warning, info',
        // Change categories as array
        'categories'=> array(
            'system.*'
         ),
        'logPath'=> '/export/home/sasori/branch/logs/',
        'logFile'=>'error.log',
    ),

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.