tread
tread

Reputation: 11108

Yii framework 1 how to show nice framework errors again?

I remember that yii used to show nice errors with an awesome stacktrace. How do I get a helpful error again? Now I get rather unhelpful framework errors (as xdebug does well for php errors) like this:

Error 404

The system is unable to find the requested action "symbols".

No line number, no trace.

error.php:

<?php
/* @var $this SiteController */
/* @var $error array */

$this->pageTitle=Yii::app()->name . ' - Error';
$this->breadcrumbs=array(
    'Error',
);
?>

<h2>Error <?php echo $code; ?></h2>

<div class="error">
<?php echo CHtml::encode($message); ?>
</div>

Upvotes: 0

Views: 121

Answers (2)

Passionate Coder
Passionate Coder

Reputation: 7294

If you are using default Yii main.php file then all the logs go to your protected/runtime/application.log file. It will include standard Yii logs as well as you own Yii::log() calls too.

To see error in Yii you have two change in two places 1st in index.php

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true); // you can also set trace levels

second in config/main.php

'preload'=>array('log')

Upvotes: 0

ScaisEdge
ScaisEdge

Reputation: 133400

be sure in you app\index.php you have a proper YII_DEBUG configuration

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); // development configuration 
//defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',0); // production configuration 

Upvotes: 1

Related Questions