Skip to content

Instantly share code, notes, and snippets.

Created December 31, 2012 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4420137 to your computer and use it in GitHub Desktop.
Save anonymous/4420137 to your computer and use it in GitHub Desktop.
Yii Framework: logging DB queries and params
// In the app configuration:
'components' => array(
'db' => array(
'enableParamLogging' => true, // self explanatory
),
'log' => array(
'routes' => array(
array(
'class' => 'CFileLogRoute',
'categories' => 'system.db.CDbCommand', // and other properties appropriate for the log route, e. g. filename
),
),
),
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment