The FDbWebLogRoute is a CWebLogRoute extension solely for logging SQL queries. While you can log ALL the SQL using Yii profiling (See http://www.yiiframework.com/doc/guide/1.1/en/topics.logging#profiling-sql-executions) this could be prettier with FDbWebLogRoute because the profiler always gives you a start and a end log for each query. It means you see one query twice.
This logroute also use Google code prettier JS library to beautify the SQLs a bit. Some color and highlighting to save your eyes.
Google code prettier library. This is not distributed with the extension. Download is here: http://code.google.com/p/google-code-prettify/
The intension of this extension is for debugging your SQL. If you need profiling, identify the bottleneck SQL, do use Yii profiling.
To log a query:
dbLogBegin(); Post::model()->findAll(); dbLogEnd();
Same way of dbLogBegin/End wrapping your code to log all queries executed in the code block. i.e. put these function at the begin and end of your controller's action.
Put this file under extensions/logging/ folder
Put Google code prettify library under extensions/scripts/code.prettify (rename the 'src' folder in your download by 'code.prettify'). If this is not what you want, edit line #58, #59 in FDbWebLogRoute.php
// db component in config/main.php 'db' => array( ... 'enableProfiling'=>true, //optional, if you also need profiling 'enableParamLogging'=>true, //to show parameter values ), // log component in config/main.php 'log' => array( 'class' => 'CLogRouter', 'routes' => array( ... 'dbLog' => array( 'class' => 'ext.logging.FDbWebLogRoute', //if you put this file under extensions/logging/ fodler ), ),