public static void rollingPolicyForAppender(RollingFileAppender rollingFileAppender, String maxFileSize, String totalSizeCap, int maxHistory) { SizeAndTimeBasedRollingPolicy rollingPolicy = new SizeAndTimeBasedRollingPolicy(); rollingPolicy.setContext(LOGGER_CONTEXT); rollingPolicy.setMaxHistory(maxHistory); rollingPolicy.setMaxFileSize(FileSize.valueOf(maxFileSize)); rollingPolicy.setTotalSizeCap(FileSize.valueOf(totalSizeCap)); rollingPolicy.setFileNamePattern(rollingFileAppender.rawFileProperty() + ".%d{yyyy-MM-dd}.%i.gz"); rollingPolicy.setParent(rollingFileAppender); rollingFileAppender.setRollingPolicy(rollingPolicy); rollingPolicy.start(); }
if (rawFileProperty() != null) { addWarn("Setting \"File\" property to null on account of prudent mode"); setFile(null);
@Test public void testPrudentModeLogicalImplications() { rfa.setContext(context); // prudent mode will force "file" property to be null rfa.setFile("some non null value"); rfa.setAppend(false); rfa.setPrudent(true); tbrp .setFileNamePattern(CoreTestConstants.OUTPUT_DIR_PREFIX + "toto-%d.log"); tbrp.start(); rfa.setRollingPolicy(tbrp); rfa.start(); assertTrue(rfa.isAppend()); assertNull(rfa.rawFileProperty()); assertTrue(rfa.isStarted()); }
if (rawFileProperty() != null) { addWarn("Setting \"File\" property to null on account of prudent mode"); setFile(null);
if (rawFileProperty() != null) { addWarn("Setting \"File\" property to null on account of prudent mode"); setFile(null);
if (rawFileProperty() != null) { addWarn("Setting \"File\" property to null on account of prudent mode"); setFile(null);
if (rawFileProperty() != null) { addWarn("Setting \"File\" property to null on account of prudent mode"); setFile(null);
if (rawFileProperty() != null) { addWarn("Setting \"File\" property to null on account of prudent mode"); setFile(null);
if (rawFileProperty() != null) { addWarn("Setting \"File\" property to null on account of prudent mode"); setFile(null);
if (rawFileProperty() != null) { addWarn("Setting \"File\" property to null on account of prudent mode"); setFile(null);
if (rawFileProperty() != null) { addWarn("Setting \"File\" property to null on account of prudent mode"); setFile(null);