Reputation: 2623
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.
Upvotes: 7
Views: 11488
Reputation: 150
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.
Upvotes: 8
Reputation: 4334
You are configuring your log to only log messages related to 'error, warning, and info',
And you are trying to Log, "trace" (Yii::trace) and "profile" levels, thats why you are not getting anything.
Also: dont try to log "profile" things on you own, there are specific methods for that, namely Yii::beginProfile() and Yii::endProfile, read more about profiling at the yii guide
Upvotes: 2
Reputation: 1409
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.*',
),
Upvotes: 7
Reputation: 2583
This is most likely a permissions problem. Is the runtime directory writable by your web server (Apache)?
Upvotes: 1