Show stack trace in yii structure

we get a stack trace when an error occurs during execution, as in the following figure.

see this

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

How can I activate this?

Many thanks

+5
source share
4 answers

A "stack trace" does not make much sense outside of the error scenario, but you can see that Yii has done so by turning on debugging mode. In index.php add

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

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

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

, .

YII_DEBUG !

+10

You can open this line of code in your project. config/main.php

'log'=>array(
        'class'=>'CLogRouter',
        'routes'=>array(
            array(
                'class'=>'CFileLogRoute',
                'levels'=>'error, warning',
            ),
            // uncomment the following to show log messages on web pages

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

        ),
    ),
+2
source

If you have determined the routing of the file in the configuration file, you can see the logs in the log file stored in the runtime directory.

File log routing is defined as follows:

...
'routes'=>array(
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'trace, info',
                    'categories'=>'system.*',
                ),
         )
0
source

All Articles