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

x33g5p2x  于2022-01-28 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(296)

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

RollingFileAppender.getFile介绍

暂无

代码示例

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

currentlyActiveFile = new File(getFile());
addInfo("Active log file name: " + getFile());
super.start();

代码示例来源:origin: com.github.tianjing/tgtools.web

/**
 * 获取文件路径
 * @return
 */
@Override
public String getFile() {
  LogHelper.info("", "日志地址开始:" + super.fileName, "LogbackRollingFileAppender");
  String path = Platform.getServerPath();
  return path+super.getFile();
}

代码示例来源:origin: stackoverflow.com

private static final String LOG4J_ROLLING_FILE_NAME_TOKEN = "Launcher";

/*
 * Change the name of the the log file as configured through log4j.xml
 * by replacing the placeholder file name token ("Launcher") with the
 * a new "actionName".
 */
private static void log4jConfig(String actionName) {

  org.apache.log4j.Logger rootLogger = LogManager.getRootLogger();
  RollingFileAppender fileAppender = (RollingFileAppender)rootLogger.getAppender("fileAppender");

  // <param name="FileNamePattern" value="/var/log/Launcher.log.%d{yyyy-MM-dd}.gz"/>
  String currentLogFile = fileAppender.getFile();
  String newLogPattern = currentLogFile.replace(LOG4J_ROLLING_FILE_NAME_TOKEN, actionName);
  fileAppender.setFile(newLogPattern);

  TimeBasedRollingPolicy timeBasedRollingPolicy = (TimeBasedRollingPolicy) fileAppender.getRollingPolicy();
  String fileNamePattern = timeBasedRollingPolicy.getFileNamePattern();
  String newFileNamePattern = fileNamePattern.replace(LOG4J_ROLLING_FILE_NAME_TOKEN, actionName);;
  timeBasedRollingPolicy.setFileNamePattern(newFileNamePattern);
  timeBasedRollingPolicy.activateOptions();

  fileAppender.activateOptions();

  LOG.info("  Redirected launcher log output to log pattern: " + newFileNamePattern);
}

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

currentlyActiveFile = new File(getFile());
addInfo("Active log file name: " + getFile());
super.start();

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

currentlyActiveFile = new File(getFile());
addInfo("Active log file name: " + getFile());
super.start();

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

currentlyActiveFile = new File(getFile());
addInfo("Active log file name: " + getFile());
super.start();

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

currentlyActiveFile = new File(getFile());
addInfo("Active log file name: " + getFile());
super.start();

代码示例来源:origin: org.opendaylight.controller/logback-config

PatternLayoutEncoder encoder = (PatternLayoutEncoder) rollingApp.getEncoder();
app.setEncoderPattern(encoder.getPattern());
app.setFileName(rollingApp.getFile());
if (rollingApp.getRollingPolicy() instanceof FixedWindowRollingPolicy) {
  FixedWindowRollingPolicy rollingPolicy = (FixedWindowRollingPolicy) rollingApp

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

private void doRestart(String testId, String patternPart, boolean fileOptionIsSet, int waitDuration) {
 // change the timestamp of the currently actively file
 File activeFile = new File(rfa1.getFile());
 activeFile.setLastModified(currentTime);
 incCurrentTime(waitDuration);
 String filePatternStr = randomOutputDir + patternPart + "-%d{" + DATE_PATTERN_WITH_SECONDS + ", GMT}";
 String fileName = fileOptionIsSet ? testId2FileName(testId) : null;
 initRFA(rfa2, fileName);
 initTRBP(rfa2, tbrp2, filePatternStr, currentTime);
 for (int i = 0; i < 3; i++) {
  rfa2.doAppend("World---" + i);
  addExpectedFileNamedIfItsTime_ByDate(filePatternStr);
  incCurrentTime(400);
  tbrp2.timeBasedFileNamingAndTriggeringPolicy.setCurrentTime(currentTime);
  add(tbrp2.compressionFuture);
  add(tbrp2.cleanUpFuture);
 }
 rfa2.stop();
}

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

currentlyActiveFile = new File(getFile());
addInfo("Active log file name: " + getFile());
super.start();

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

currentlyActiveFile = new File(getFile());
addInfo("Active log file name: " + getFile());
super.start();

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

currentlyActiveFile = new File(getFile());
addInfo("Active log file name: " + getFile());
super.start();

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

currentlyActiveFile = new File(getFile());
addInfo("Active log file name: " + getFile());
super.start();

相关文章