Package ch.qos.logback.core.rolling.helper

Examples of ch.qos.logback.core.rolling.helper.Compressor


      addWarn(CoreConstants.SEE_FNP_NOT_SET);
      throw new IllegalStateException(FNP_NOT_SET
          + CoreConstants.SEE_FNP_NOT_SET);
    }

    compressor = new Compressor(compressionMode);
    compressor.setContext(context);

    // wcs : without compression suffix
    fileNamePatternWCS = new FileNamePattern(computeFileNameStr_WCS(
        fileNamePatternStr, compressionMode), this.context);
View Full Code Here


      throw new IllegalStateException("FileNamePattern ["
          + fileNamePattern.getPattern()
          + "] does not contain a valid IntegerToken");
    }

    compressor = new Compressor(compressionMode);
    compressor.setContext(this.context);
  }
View Full Code Here

          addInfo("Skipping roll=over for inexistent file " + toRenameStr);
        }
      }

      // move active file name to min
      Compressor compressor;
      switch (compressionMode) {
      case NONE:
        util.rename(getActiveFileName(), fileNamePattern
            .convertInt(minIndex));
        break;
      case GZ:
        compressor = new Compressor(CompressionMode.GZ,
            getActiveFileName(), fileNamePattern.convertInt(minIndex));
        compressor.setContext(this.context);
        compressor.compress();
        break;
      case ZIP:
        compressor = new Compressor(CompressionMode.ZIP,
            getActiveFileName(), fileNamePattern.convertInt(minIndex));
        compressor.setContext(this.context);
        compressor.compress();
        break;
      }
    }
  }
View Full Code Here

    }
  }

  void doCompression(boolean renameToTempFile, String nameOfFile2Compress,
      String nameOfCompressedFile) throws RolloverFailure {
    Compressor compressor = null;

    if (renameToTempFile) {
      String tmpTarget = nameOfFile2Compress + System.nanoTime() + ".tmp";
      util.rename(getParentsRawFileProperty(), tmpTarget);
      nameOfFile2Compress = tmpTarget;
    }

    switch (compressionMode) {
    case GZ:
      addInfo("GZIP compressing [" + nameOfFile2Compress + "].");
      compressor = new Compressor(CompressionMode.GZ, nameOfFile2Compress,
          nameOfCompressedFile);
      compressor.setContext(this.context);
      break;
    case ZIP:
      addInfo("ZIP compressing [" + nameOfFile2Compress + "]");
      compressor = new Compressor(CompressionMode.ZIP, nameOfFile2Compress,
          nameOfCompressedFile);
      compressor.setContext(this.context);
      break;
    }

    AsynchronousCompressor ac = new AsynchronousCompressor(compressor);
    future = ac.compressAsynchronously();
View Full Code Here

      throw new IllegalStateException("FileNamePattern ["
          + fileNamePattern.getPattern()
          + "] does not contain a valid IntegerToken");
    }

    compressor = new Compressor(compressionMode);
    compressor.setContext(this.context);
  }
View Full Code Here

          addInfo("Skipping roll=over for inexistent file " + toRenameStr);
        }
      }

      // move active file name to min
      Compressor compressor;
      switch (compressionMode) {
      case NONE:
        util.rename(getActiveFileName(), fileNamePattern
            .convertInt(minIndex));
        break;
      case GZ:
        compressor = new Compressor(CompressionMode.GZ,
            getActiveFileName(), fileNamePattern.convertInt(minIndex));
        compressor.setContext(this.context);
        compressor.compress();
        break;
      case ZIP:
        compressor = new Compressor(CompressionMode.ZIP,
            getActiveFileName(), fileNamePattern.convertInt(minIndex));
        compressor.setContext(this.context);
        compressor.compress();
        break;
      }
    }
  }
View Full Code Here

    }
  }

  void doCompression(boolean renameToTempFile, String nameOfFile2Compress,
      String nameOfCompressedFile) throws RolloverFailure {
    Compressor compressor = null;

    if (renameToTempFile) {
      String tmpTarget = nameOfFile2Compress + System.nanoTime() + ".tmp";
      util.rename(getParentsRawFileProperty(), tmpTarget);
      nameOfFile2Compress = tmpTarget;
    }

    switch (compressionMode) {
    case GZ:
      addInfo("GZIP compressing [" + nameOfFile2Compress + "].");
      compressor = new Compressor(CompressionMode.GZ, nameOfFile2Compress,
          nameOfCompressedFile);
      compressor.setContext(this.context);
      break;
    case ZIP:
      addInfo("ZIP compressing [" + nameOfFile2Compress + "]");
      compressor = new Compressor(CompressionMode.ZIP, nameOfFile2Compress,
          nameOfCompressedFile);
      compressor.setContext(this.context);
      break;
    }

    AsynchronousCompressor ac = new AsynchronousCompressor(compressor);
    future = ac.compressAsynchronously();
View Full Code Here

      addWarn(CoreConstants.SEE_FNP_NOT_SET);
      throw new IllegalStateException(FNP_NOT_SET
          + CoreConstants.SEE_FNP_NOT_SET);
    }

    compressor = new Compressor(compressionMode);
    compressor.setContext(context);

    // wcs : without compression suffix
    fileNamePatternWCS = new FileNamePattern(computeFileNameStr_WCS(
        fileNamePatternStr, compressionMode), this.context);
View Full Code Here

          addInfo("Skipping roll=over for inexistent file " + toRenameStr);
        }
      }

      // move active file name to min
      Compressor compressor;
      switch (compressionMode) {
      case NONE:
        util.rename(getNewActiveFileName(), fileNamePattern
            .convertInt(minIndex));
        break;
      case GZ:
        compressor = new Compressor(CompressionMode.GZ,
            getNewActiveFileName(), fileNamePattern.convertInt(minIndex));
        compressor.setContext(this.context);
        compressor.compress();
        break;
      case ZIP:
        compressor = new Compressor(CompressionMode.ZIP,
            getNewActiveFileName(), fileNamePattern.convertInt(minIndex));
        compressor.setContext(this.context);
        compressor.compress();
        break;
      }
    }
  }
View Full Code Here

  }

  void doCompression(boolean rename, String nameOfFile2Compress,
      String nameOfCompressedFile) throws RolloverFailure {
    Compressor compressor = null;

    if (rename) {
      String renameTarget = nameOfFile2Compress + System.nanoTime() + ".tmp";
      util.rename(getParentFileName(), renameTarget);
      nameOfFile2Compress = renameTarget;
    }

    switch (compressionMode) {
    case GZ:
      addInfo("GZIP compressing [" + nameOfFile2Compress + "].");
      compressor = new Compressor(CompressionMode.GZ, nameOfFile2Compress,
          nameOfCompressedFile);
      compressor.setContext(this.context);
      break;
    case ZIP:
      addInfo("ZIP compressing [" + nameOfFile2Compress + "]");
      compressor = new Compressor(CompressionMode.ZIP, nameOfFile2Compress,
          nameOfCompressedFile);
      compressor.setContext(this.context);
      break;
    }

    AsynchronousCompressor ac = new AsynchronousCompressor(compressor);
    future = ac.compressAsynchronously();
View Full Code Here

TOP

Related Classes of ch.qos.logback.core.rolling.helper.Compressor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.