I finally managed to find a solution:
In my main.php, I did this:
'log' => array( 'class' => 'CLogRouter', 'routes' => array( array( 'class' => 'CFileLogRoute', 'levels' => 'trace, info, error, warning, vardump', ), // uncomment the following to show log messages on web pages array( 'class' => 'CWebLogRoute', 'enabled' => YII_DEBUG, 'levels' => 'error, warning, trace, notice', 'categories' => 'application', 'showInFireBug' => false, ), ), ),
In my controller, I used this code:
$a = new array(1,2,3); Yii::trace(CVarDumper::dumpAsString($a));
The application log is shown below on each page.
source share