Ejemplo n.º 1
0
 public function init()
 {
     date_default_timezone_set("PRC");
     $tableId = Log::getLogTableId();
     $this->logTableName = Log::getTableName($tableId);
     parent::init();
 }
Ejemplo n.º 2
0
 public function processLogs($logs)
 {
     parent::processLogs($logs);
     $count = $this->getDbConnection()->createCommand('SELECT COUNT(*) FROM ' . $this->logTableName)->queryScalar();
     if ($count >= LOGGER_TABLE_MAX_RECORDS) {
         $query = "DELETE FROM {$this->logTableName} limit 200";
         $command = Yii::app()->db->createCommand($query);
         $command->execute();
     }
 }
Ejemplo n.º 3
0
 public function init()
 {
     parent::init();
     Yii::getLogger()->autoFlush = 1;
     Yii::getLogger()->autoDump = true;
 }