enableAllTypes() public static method

public static enableAllTypes ( )
Ejemplo n.º 1
0
 protected function log($time, $message, $logLevel, $logGroup, $ip, $file, $line, $type = null)
 {
     if ($message == "") {
         return;
     }
     $timeString = strftime("Y-m-d H:i:s", $time);
     $userId = null;
     try {
         $userId = Gpf_Session::getAuthUser()->getUserId();
     } catch (Gpf_Exception $e) {
     }
     try {
         $dbLog = new Gpf_Db_Log();
         $dbLog->set('groupid', $logGroup);
         $dbLog->set('level', $logLevel);
         $dbLog->set('created', $timeString);
         $dbLog->set('filename', $file);
         $dbLog->set('message', $message);
         $dbLog->set('line', $line);
         $dbLog->set('ip', $ip);
         $dbLog->set('accountuserid', $userId);
         $dbLog->set(Gpf_Db_Table_Logs::TYPE, $type);
         $dbLog->save();
     } catch (Exception $e) {
         Gpf_Log::disableType(Gpf_Log_LoggerDatabase::TYPE);
         Gpf_Log::error($this->_sys("Database Logger Error. Logging on display: %s", $message));
         Gpf_Log::enableAllTypes();
     }
 }
Ejemplo n.º 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());
 }
Ejemplo n.º 3
0
 protected function logException()
 {
     Gpf_Log::disableType(Gpf_Log_LoggerDatabase::TYPE);
     Gpf_Log::error($this->getMessage());
     Gpf_Log::enableAllTypes();
 }