Ejemplo n.º 1
0
 public function processWriteLogs($logs = array())
 {
     try {
         parent::processLogs($logs);
     } catch (Exception $_ex) {
         error_log(__METHOD__ . ': Exception processing application logs: ' . $_ex->getMessage());
     }
 }
Ejemplo n.º 2
0
 protected function processLogs($logs)
 {
     $result = array();
     foreach ($logs as $log) {
         if (!($log[1] === CLogger::LEVEL_PROFILE && mb_strpos($log[0], 'begin:system.db.CDbCommand') === 0)) {
             continue;
         }
         if (($sql = $this->formatLogSql($log[0])) !== false) {
             $result[] = array($sql, $log[1], $log[2], $log[3]);
         }
     }
     //Чтобы была пустая строка между группами запросов
     if (!empty($result)) {
         if ($this->logOnlyQuery && $this->sqlGroupDateFormat !== false) {
             $result[0][0] = '-- ' . date($this->sqlGroupDateFormat) . "\n" . $result[0][0];
         }
         $result[count($result) - 1][0] .= "\n";
     } else {
         return;
     }
     parent::processLogs($result);
 }