Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

show stack trace in yii framework

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

like image 700
Joyal Avatar asked Aug 31 '12 05:08

Joyal


People also ask

How do I view stack trace?

If the Console view is not visible, go to the menu option Window -> Show View and select Console. and then select Java Stack Trace Console from the drop-down list. Paste your stack trace into the console. It will then provide a list of links into your source code and any other source code available.

What is $App in Yii?

$app=Yii::createWebApplication($configFile); Tip: If the application configuration is very complex, we can split it into several files, each returning a portion of the configuration array.

What is the function of stack trace?

A stack trace shows where in the program flow execution stopped and how execution reached this point. It provides the most concise description of your program's state.

Is Yii Framework easy to learn?

Yii certainly requires good programming skills, PHP, at least basics of object oriented programming. If you know all that, then you can start in a week. After a month or two you'll be doing things correctly. After about 3 months you should be comfortable.


2 Answers

There is a lot of tracing information available in the Yii debug toolbar: http://www.yiiframework.com/extension/yii-debug-toolbar/

Might be what you are after

like image 30
acorncom Avatar answered Sep 24 '22 18:09

acorncom


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!

like image 171
Ansari Avatar answered Sep 25 '22 18:09

Ansari