sarvesh
(Sarveshphptech)
June 18, 2012, 10:38am
1
I am trying to set CDbLogRoute parameters, but not able to store the data in YiiLog table,
Please clarify connectionID parameter
array(
'class'=>'DBLogRoute',
'levels'=>'error, warning',
'connectionID'=>'db',
'logTableName'=>'YiiLog',
),
bettor
(Live Webscore)
June 19, 2012, 10:28am
2
have you defined your database connection in the main.php configuration?
sarvesh
(Sarveshphptech)
July 4, 2012, 11:38am
3
Sorry for late reply,
i have defined DB connections in main.php
If you want save logs in separate db, you can use this config\main.php
'log_db'=>array(
'class'=>'CDbConnection',
'connectionString' => 'mysql:host=localhost;dbname=your_dbname',
'emulatePrepare' => true,
'username' => 'root',
'password' => '',
'charset' => 'utf8',
),
to save logs in DB use ‘CDbLogRoute’ class
array(
'class'=>'CDbLogRoute',
'connectionID'=>'log_db',
//'logTableName'=>'yii_logs', // you can use your own created table name
'categories'=>'error, warning',
'levels'=>'error, warning',
'autoCreateLogTable'=>true, // it will create auto log table, that will "yiilog"
),