Package ch.qos.logback.core.rolling

Examples of ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicy


    RollingFileAppender<ILoggingEvent> rfa = (RollingFileAppender<ILoggingEvent>) root
            .getAppender("ROLLING");

    TimeBasedRollingPolicy tprp = (TimeBasedRollingPolicy<ILoggingEvent>) rfa
            .getTriggeringPolicy();
    TimeBasedFileNamingAndTriggeringPolicy tbnatp = tprp
            .getTimeBasedFileNamingAndTriggeringPolicy();

    String prefix = "Hello---";
    int runLength = 4;
    for (int i = 0; i < runLength; i++) {
      logger.debug(prefix + i);
      addExpectedFileNamedIfItsTime_ByDate(randomOutputDir, testId, false);
      incCurrentTime(500);
      tbnatp.setCurrentTime(currentTime);
    }

    existenceCheck(expectedFilenameList);
    sortedContentCheck(randomOutputDir, runLength, prefix);
  }
View Full Code Here


    statusChecker.assertIsErrorFree();

    TimeBasedRollingPolicy tprp = (TimeBasedRollingPolicy<ILoggingEvent>) rfa
            .getTriggeringPolicy();
    TimeBasedFileNamingAndTriggeringPolicy tbnatp = tprp
            .getTimeBasedFileNamingAndTriggeringPolicy();

    int timeIncrement = 1000 / approxWritesPerPeriod;
    int runLength = approxWritesPerPeriod * 3;
    for (int i = 0; i < runLength; i++) {
      String msg = prefix + i;
      logger.debug(msg);
      addExpectedFileNamedIfItsTime(testId, msg, false);
      incCurrentTime(timeIncrement);
      tbnatp.setCurrentTime(currentTime);
    }

    sortedContentCheck(randomOutputDir, runLength, prefix);
    int eCount = existenceCount(expectedFilenameList);
    // for various reasons, it is extremely difficult to have the files
View Full Code Here

TOP

Related Classes of ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicy

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.