show stack trace in yii framework

Joyal picture Joyal · Aug 31, 2012 · Viewed 13.5k times · Source

we get stack trace when an error occurs in the execution, like in the following picture .

see this

I would like to see this tracing at the bottom of the page every time I executes a page. ( even without errors) so that I can find out what are the pages ran and what is happening inside the framework

How can I activate this ?

Thank you very much

Answer

Ansari picture Ansari · Aug 31, 2012

A "stack trace" doesn't make much sense outside of an error scenario, but you can see what Yii is up to by enabling the debug mode. In your index.php add

defined('YII_DEBUG') or define('YII_DEBUG',true);

and in the log component of your main Yii configuration array (config/main.php), add this array under the routes component:

            array(
                'class'=>'CWebLogRoute',
                'enabled' => YII_DEBUG,
            ),

This should show you what you want.

Make sure to remove the YII_DEBUG line from your production code!