ch.qos.logback.core.rolling.TimeBasedRollingPolicy.getParentsRawFileProperty()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(12.2k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中ch.qos.logback.core.rolling.TimeBasedRollingPolicy.getParentsRawFileProperty()方法的一些代码示例,展示了TimeBasedRollingPolicy.getParentsRawFileProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TimeBasedRollingPolicy.getParentsRawFileProperty()方法的具体详情如下:
包路径:ch.qos.logback.core.rolling.TimeBasedRollingPolicy
类名称:TimeBasedRollingPolicy
方法名:getParentsRawFileProperty

TimeBasedRollingPolicy.getParentsRawFileProperty介绍

暂无

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

Future renamedRawAndAsyncCompress(String nameOfCompressedFile, String innerEntryName)
  throws RolloverFailure {
 String parentsRawFile = getParentsRawFileProperty();
 String tmpTarget = parentsRawFile + System.nanoTime() + ".tmp";
 renameUtil.rename(parentsRawFile, tmpTarget);
 return asyncCompress(tmpTarget, nameOfCompressedFile, innerEntryName);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * 
 * The active log file is determined by the value of the parent's filename
 * option. However, in case the file name is left blank, then, the active log
 * file equals the file name for the current period as computed by the
 * <b>FileNamePattern</b> option.
 * 
 * <p>The RollingPolicy must know whether it is responsible for changing the
 * name of the active file or not. If the active file name is set by the user
 * via the configuration file, then the RollingPolicy must let it like it is.
 * If the user does not specify an active file name, then the RollingPolicy
 * generates one.
 * 
 * <p> To be sure that the file name used by the parent class has been
 * generated by the RollingPolicy and not specified by the user, we keep track
 * of the last generated name object and compare its reference to the parent
 * file name. If they match, then the RollingPolicy knows it's responsible for
 * the change of the file name.
 * 
 */
public String getActiveFileName() {
 String parentsRawFileProperty = getParentsRawFileProperty();
 if (parentsRawFileProperty != null) {
  return parentsRawFileProperty;
 } else {
  return timeBasedFileNamingAndTriggeringPolicy
    .getCurrentPeriodsFileNameWithoutCompressionSuffix();
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

void computeCurrentPeriodsHighestCounterValue(final String stemRegex) {
 File file = new File(getCurrentPeriodsFileNameWithoutCompressionSuffix());
 File parentDir = file.getParentFile();
 File[] matchingFileArray = FileFilterUtil
     .filesInFolderMatchingStemRegex(parentDir, stemRegex);
 if (matchingFileArray == null || matchingFileArray.length == 0) {
  currentPeriodsCounter = 0;
  return;
 }
 currentPeriodsCounter = FileFilterUtil.findHighestCounter(matchingFileArray, stemRegex);
 // if parent raw file property is not null, then the next
 // counter is max  found counter+1
 if (tbrp.getParentsRawFileProperty() != null || (tbrp.compressionMode != CompressionMode.NONE)) {
  // TODO test me
  currentPeriodsCounter++;
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

public void rollover() throws RolloverFailure {
 // when rollover is called the elapsed period's file has
 // been already closed. This is a working assumption of this method.
 String elapsedPeriodsFileName = timeBasedFileNamingAndTriggeringPolicy
   .getElapsedPeriodsFileName();
 String elapsedPeriodStem = FileFilterUtil.afterLastSlash(elapsedPeriodsFileName);
 if (compressionMode == CompressionMode.NONE) {
  if (getParentsRawFileProperty() != null) {
   renameUtil.rename(getParentsRawFileProperty(), elapsedPeriodsFileName);
  } // else { nothing to do if CompressionMode == NONE and parentsRawFileProperty == null }
 } else {
  if (getParentsRawFileProperty() == null) {
   future = asyncCompress(elapsedPeriodsFileName, elapsedPeriodsFileName, elapsedPeriodStem);
  } else {
   future = renamedRawAndAsyncCompress(elapsedPeriodsFileName, elapsedPeriodStem);
  }
 }
 if (archiveRemover != null) {
  archiveRemover.clean(new Date(timeBasedFileNamingAndTriggeringPolicy.getCurrentTime()));
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

public void start() {
 DateTokenConverter dtc = tbrp.fileNamePattern.getPrimaryDateTokenConverter();
 if (dtc == null) {
  throw new IllegalStateException("FileNamePattern ["
      + tbrp.fileNamePattern.getPattern()
      + "] does not contain a valid DateToken");
 }
 rc = new RollingCalendar();
 rc.init(dtc.getDatePattern());
 addInfo("The date pattern is '" + dtc.getDatePattern()
     + "' from file name pattern '" + tbrp.fileNamePattern.getPattern()
     + "'.");
 rc.printPeriodicity(this);
 setDateInCurrentPeriod(new Date(getCurrentTime()));
 if (tbrp.getParentsRawFileProperty() != null) {
  File currentFile = new File(tbrp.getParentsRawFileProperty());
  if (currentFile.exists() && currentFile.canRead()) {
   setDateInCurrentPeriod(new Date(currentFile.lastModified()));
  }
 }
 addInfo("Setting initial period to " + dateInCurrentPeriod);
 computeNextCheck();
}

代码示例来源:origin: tony19/logback-android

Future<?> renameRawAndAsyncCompress(String nameOfCompressedFile, String innerEntryName)
  throws RolloverFailure {
 String parentsRawFile = getParentsRawFileProperty();
 String tmpTarget = nameOfCompressedFile + System.nanoTime() + ".tmp";
 renameUtil.rename(parentsRawFile, tmpTarget);
 return compressor.asyncCompress(tmpTarget, nameOfCompressedFile, innerEntryName);
}

代码示例来源:origin: Nextdoor/bender

Future<?> renameRawAndAsyncCompress(String nameOfCompressedFile, String innerEntryName) throws RolloverFailure {
  String parentsRawFile = getParentsRawFileProperty();
  String tmpTarget = nameOfCompressedFile + System.nanoTime() + ".tmp";
  renameUtil.rename(parentsRawFile, tmpTarget);
  return compressor.asyncCompress(tmpTarget, nameOfCompressedFile, innerEntryName);
}

代码示例来源:origin: ch.qos.logback/core

Future renamedRawAndAsyncCompress(String nameOfCompressedFile, String innerEntryName)
  throws RolloverFailure {
 String parentsRawFile = getParentsRawFileProperty();
 String tmpTarget = parentsRawFile + System.nanoTime() + ".tmp";
 renameUtil.rename(parentsRawFile, tmpTarget);
 return asyncCompress(tmpTarget, nameOfCompressedFile, innerEntryName);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

Future renamedRawAndAsyncCompress(String nameOfCompressedFile, String innerEntryName)
  throws RolloverFailure {
 String parentsRawFile = getParentsRawFileProperty();
 String tmpTarget = parentsRawFile + System.nanoTime() + ".tmp";
 renameUtil.rename(parentsRawFile, tmpTarget);
 return asyncCompress(tmpTarget, nameOfCompressedFile, innerEntryName);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

Future<?> renameRawAndAsyncCompress(String nameOfCompressedFile, String innerEntryName) throws RolloverFailure {
  String parentsRawFile = getParentsRawFileProperty();
  String tmpTarget = nameOfCompressedFile + System.nanoTime() + ".tmp";
  renameUtil.rename(parentsRawFile, tmpTarget);
  return compressor.asyncCompress(tmpTarget, nameOfCompressedFile, innerEntryName);
}

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

Future renamedRawAndAsyncCompress(String nameOfCompressedFile)
  throws RolloverFailure {
 String parentsRawFile = getParentsRawFileProperty();
 String tmpTarget = parentsRawFile + System.nanoTime() + ".tmp";
 renameUtil.rename(parentsRawFile, tmpTarget);
 return asyncCompress(tmpTarget, nameOfCompressedFile);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

Future<?> renameRawAndAsyncCompress(String nameOfCompressedFile, String innerEntryName) throws RolloverFailure {
  String parentsRawFile = getParentsRawFileProperty();
  String tmpTarget = nameOfCompressedFile + System.nanoTime() + ".tmp";
  renameUtil.rename(parentsRawFile, tmpTarget);
  return compressor.asyncCompress(tmpTarget, nameOfCompressedFile, innerEntryName);
}

代码示例来源:origin: com.hynnet/logback-core

Future renamedRawAndAsyncCompress(String nameOfCompressedFile, String innerEntryName)
  throws RolloverFailure {
 String parentsRawFile = getParentsRawFileProperty();
 String tmpTarget = parentsRawFile + System.nanoTime() + ".tmp";
 renameUtil.rename(parentsRawFile, tmpTarget);
 return asyncCompress(tmpTarget, nameOfCompressedFile, innerEntryName);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

void computeCurrentPeriodsHighestCounterValue(final String stemRegex) {
  File file = new File(getCurrentPeriodsFileNameWithoutCompressionSuffix());
  File parentDir = file.getParentFile();
  File[] matchingFileArray = FileFilterUtil.filesInFolderMatchingStemRegex(parentDir, stemRegex);
  if (matchingFileArray == null || matchingFileArray.length == 0) {
    currentPeriodsCounter = 0;
    return;
  }
  currentPeriodsCounter = FileFilterUtil.findHighestCounter(matchingFileArray, stemRegex);
  // if parent raw file property is not null, then the next
  // counter is max found counter+1
  if (tbrp.getParentsRawFileProperty() != null || (tbrp.compressionMode != CompressionMode.NONE)) {
    // TODO test me
    currentPeriodsCounter++;
  }
}

代码示例来源:origin: tony19/logback-android

void computeCurrentPeriodsHighestCounterValue(final String stemRegex) {
 File file = new File(getCurrentPeriodsFileNameWithoutCompressionSuffix());
 File parentDir = file.getParentFile();
 File[] matchingFileArray = FileFilterUtil
     .filesInFolderMatchingStemRegex(parentDir, stemRegex);
 if (matchingFileArray == null || matchingFileArray.length == 0) {
  currentPeriodsCounter = 0;
  return;
 }
 currentPeriodsCounter = FileFilterUtil.findHighestCounter(matchingFileArray, stemRegex);
 // if parent raw file property is not null, then the next
 // counter is max  found counter+1
 if (tbrp.getParentsRawFileProperty() != null || (tbrp.compressionMode != CompressionMode.NONE)) {
  // TODO test me
  currentPeriodsCounter++;
 }
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

void computeCurrentPeriodsHighestCounterValue(final String stemRegex) {
  File file = new File(getCurrentPeriodsFileNameWithoutCompressionSuffix());
  File parentDir = file.getParentFile();
  File[] matchingFileArray = FileFilterUtil.filesInFolderMatchingStemRegex(parentDir, stemRegex);
  if (matchingFileArray == null || matchingFileArray.length == 0) {
    currentPeriodsCounter = 0;
    return;
  }
  currentPeriodsCounter = FileFilterUtil.findHighestCounter(matchingFileArray, stemRegex);
  // if parent raw file property is not null, then the next
  // counter is max found counter+1
  if (tbrp.getParentsRawFileProperty() != null || (tbrp.compressionMode != CompressionMode.NONE)) {
    // TODO test me
    currentPeriodsCounter++;
  }
}

代码示例来源:origin: ch.qos.logback/core

void computeCurrentPeriodsHighestCounterValue(final String stemRegex) {
 File file = new File(getCurrentPeriodsFileNameWithoutCompressionSuffix());
 File parentDir = file.getParentFile();
 File[] matchingFileArray = FileFilterUtil
     .filesInFolderMatchingStemRegex(parentDir, stemRegex);
 if (matchingFileArray == null || matchingFileArray.length == 0) {
  currentPeriodsCounter = 0;
  return;
 }
 currentPeriodsCounter = FileFilterUtil.findHighestCounter(matchingFileArray, stemRegex);
 // if parent raw file property is not null, then the next
 // counter is max  found counter+1
 if (tbrp.getParentsRawFileProperty() != null || (tbrp.compressionMode != CompressionMode.NONE)) {
  // TODO test me
  currentPeriodsCounter++;
 }
}

代码示例来源:origin: com.hynnet/logback-core

void computeCurrentPeriodsHighestCounterValue(final String stemRegex) {
 File file = new File(getCurrentPeriodsFileNameWithoutCompressionSuffix());
 File parentDir = file.getParentFile();
 File[] matchingFileArray = FileFilterUtil
     .filesInFolderMatchingStemRegex(parentDir, stemRegex);
 if (matchingFileArray == null || matchingFileArray.length == 0) {
  currentPeriodsCounter = 0;
  return;
 }
 currentPeriodsCounter = FileFilterUtil.findHighestCounter(matchingFileArray, stemRegex);
 // if parent raw file property is not null, then the next
 // counter is max  found counter+1
 if (tbrp.getParentsRawFileProperty() != null || (tbrp.compressionMode != CompressionMode.NONE)) {
  // TODO test me
  currentPeriodsCounter++;
 }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

void computeCurrentPeriodsHighestCounterValue(final String stemRegex) {
 File file = new File(getCurrentPeriodsFileNameWithoutCompressionSuffix());
 File parentDir = file.getParentFile();
 File[] matchingFileArray = FileFilterUtil
     .filesInFolderMatchingStemRegex(parentDir, stemRegex);
 if (matchingFileArray == null || matchingFileArray.length == 0) {
  currentPeriodsCounter = 0;
  return;
 }
 currentPeriodsCounter = FileFilterUtil.findHighestCounter(matchingFileArray, stemRegex);
 // if parent raw file property is not null, then the next
 // counter is max  found counter+1
 if (tbrp.getParentsRawFileProperty() != null || (tbrp.compressionMode != CompressionMode.NONE)) {
  // TODO test me
  currentPeriodsCounter++;
 }
}

代码示例来源:origin: Nextdoor/bender

void computeCurrentPeriodsHighestCounterValue(final String stemRegex) {
  File file = new File(getCurrentPeriodsFileNameWithoutCompressionSuffix());
  File parentDir = file.getParentFile();
  File[] matchingFileArray = FileFilterUtil.filesInFolderMatchingStemRegex(parentDir, stemRegex);
  if (matchingFileArray == null || matchingFileArray.length == 0) {
    currentPeriodsCounter = 0;
    return;
  }
  currentPeriodsCounter = FileFilterUtil.findHighestCounter(matchingFileArray, stemRegex);
  // if parent raw file property is not null, then the next
  // counter is max found counter+1
  if (tbrp.getParentsRawFileProperty() != null || (tbrp.compressionMode != CompressionMode.NONE)) {
    // TODO test me
    currentPeriodsCounter++;
  }
}

相关文章

微信公众号

最新文章

更多