Inheritance: extends Gpf_Object
 public function __construct(Gpf_Rpc_Form $form)
 {
     $this->form = $form;
     $this->logger = Gpf_Log_Logger::getInstance();
     $this->logger->add(Gpf_Log_LoggerDatabase::TYPE, Gpf_Log::DEBUG);
     $this->outputMessage = '';
 }
Exemple #2
0
 /**
  * @return Gpf_Log_Logger
  */
 private static function getLogger()
 {
     if (self::$logger == null) {
         self::$logger = Gpf_Log_Logger::getInstance();
     }
     return self::$logger;
 }
 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);
 }
Exemple #4
0
 private function initDatabaseLogger()
 {
     $logger = Gpf_Log_Logger::getInstance();
     if (!$logger->checkLoggerTypeExists(Gpf_Log_LoggerDatabase::TYPE)) {
         $logger->setGroup(Gpf_Common_String::generateId(10));
         $logLevel = Gpf_Settings::get(Gpf_Settings_Gpf::LOG_LEVEL_SETTING_NAME);
         $logger->add(Gpf_Log_LoggerDatabase::TYPE, $logLevel);
     }
 }
    /**
     * @param $type
     * @return Gpf_Log_Logger
     */
    public static function create($type = self::SYSTEM_DEBUG_TYPE) {
        $logLevel = self::getLogLevel($type);
        
        $request = new Pap_Tracking_Request();
        if($request->getDebug() == Gpf::YES) {
            $logLevel = Gpf_Log::DEBUG;
        }
        
        $logger = Gpf_Log_Logger::getInstance($type);
        $logger->setGroup(substr($type, 0, 4) . '-' . Gpf_Common_String::generateId(10));
        $logger->setType($type);
        $logger->add(Gpf_Log_LoggerDatabase::TYPE, $logLevel);

        if($request->getDebug() == Gpf::YES) {
            $logger->add(Gpf_Log_LoggerDisplay::TYPE, $logLevel);
        }
         
        return $logger;
    }
 protected function debug($msg)
 {
     if ($this->logger != null) {
         $this->logger->debug($msg);
     }
 }
Exemple #7
0
 public function log($logLevel, $message, $logGroup = null)
 {
     if ($this->_logger !== null) {
         $this->_logger->log($message, $logLevel, $logGroup);
     }
 }
 public function error($msg) {
 	if($this->logger != null) {
 		$this->logger->error(msg);
 	}
 }
 function __construct($sqlString, $message, $code)
 {
     $this->isLoggerException = Gpf_Log_Logger::isLoggerInsert($sqlString);
     $this->_code = $code;
     parent::__construct("ERROR: " . $message);
 }
 protected function logError($importObject, array $row, Gpf_Exception $e)
 {
     $this->logger->error($this->_sys('Could not import %s from %s on line %s. Throw exception: %s', $importObject, $this->file->getFileName(), implode($this->delimiter, $row), $e->getMessage()));
 }