@Override public void writePolicy(String propertyPrefix) { writeTypeProperty(propertyPrefix, "RollingFile"); writeFileNameProperty(propertyPrefix); writeFilePatternProperty(propertyPrefix, "%d{" + datePattern + "}"); putProperty(propertyPrefix + "policies.type", "Policies"); putProperty(propertyPrefix + "policies.time.type", "TimeBasedTriggeringPolicy"); putProperty(propertyPrefix + "policies.time.interval", "1"); putProperty(propertyPrefix + "policies.time.modulate", "true"); putProperty(propertyPrefix + "strategy.type", "DefaultRolloverStrategy"); putProperty(propertyPrefix + "strategy.fileIndex", "nomax"); putProperty(propertyPrefix + "strategy.action.type", "Delete"); putProperty(propertyPrefix + "strategy.action.basepath", logsDir.getAbsolutePath()); putProperty(propertyPrefix + "strategy.action.maxDepth", valueOf(1)); putProperty(propertyPrefix + "strategy.action.condition.type", "IfFileName"); putProperty(propertyPrefix + "strategy.action.condition.glob", filenamePrefix + "*"); putProperty(propertyPrefix + "strategy.action.condition.nested_condition.type", "IfAccumulatedFileCount"); putProperty(propertyPrefix + "strategy.action.condition.nested_condition.exceeds", valueOf(maxFiles)); } }