Example #1
0
 public static function removeAllHandlers($level = 0)
 {
     if ($level == 0) {
         self::$logHandlers = array();
         return;
     }
     $handlers = array();
     foreach (self::$logHandlers as $logHandler) {
         if (!self::levelBelongsToLevel($level, $logHandler['level'])) {
             $handlers[] = $logHandler;
         }
     }
     self::$logHandlers = $handlers;
 }
Example #2
0
 private function prepareRestoreLogFile($backupPath)
 {
     $file = $backupPath . '/' . $this->fileName . '_restore.log';
     $this->restoreLogPath = $file;
     $content = self::getLogFileHeader();
     $content .= PHP_EOL;
     if (!file_put_contents($file, $content)) {
         throw new SGExceptionMethodNotAllowed('Cannot create restore log file: ' . $file);
     }
     //create file log handler
     $fileLogHandler = new SGFileLogHandler($file);
     SGLog::registerLogHandler($fileLogHandler, SG_LOG_LEVEL_LOW, true);
 }
Example #3
0
 public static function clear($level = SG_LOG_LEVEL_LOW)
 {
     SGLog::clear($level);
 }