예제 #1
0
 private function initLogger()
 {
     self::$benchmarkLogger = Gpf_Log_Logger::getInstance('benchmark');
     $fileLogger = new Gpf_Log_LoggerFile();
     $fileName = $this->getLogFileName();
     $fileLogger->setFileName($fileName);
     $this->checkResetFileSize($fileName);
     self::$benchmarkLogger->addLogger($fileLogger, Gpf_Log::DEBUG);
 }
예제 #2
0
 private function handleError($sth)
 {
     if ($sth->getErrorCode() == self::CR_SERVER_GONE_ERROR) {
         Gpf_Log::disableType(Gpf_Log_LoggerDatabase::TYPE);
         Gpf_Log::info($this->_sys('MySql server has gone away: Reconnecting...'));
         Gpf_Log::enableAllTypes();
         throw new Gpf_DbEngine_ConnectionGoneException($this->_sys('MySql server has gone away.'));
     }
     Gpf_Log_Benchmark::end(self::BENCHMARK_EXECUTE, "SQL ERROR: " . $sth->getStatement());
     $this->resetFailedConnectionsCount();
     throw new Gpf_DbEngine_Driver_Mysql_SqlException($sth->getStatement(), $sth->getErrorMessage(), $sth->getErrorCode());
 }