RollingFileWithoutDeleteAppender extends FileAppender { public void setMaximumFileSize(long maxFileSize) { this.maxFileSize = maxFileSize; } RollingFileWithoutDeleteAppender();  RollingFileWithoutDeleteAppender(Layout layout, String filename,
      boolean append);  RollingFileWithoutDeleteAppender(Layout layout, String filename); long getMaximumFileSize(); void rollOver(); synchronized void setFile(String fileName, boolean append,
      boolean bufferedIO, int bufferSize); void setMaximumFileSize(long maxFileSize); void setMaxFileSize(String value);  }
@Test public void testFileNamePattern() throws Throwable { if (dataDir == null) { fail("Excepted temp folder for audit log is created."); } RollingFileWithoutDeleteAppender appender = new RollingFileWithoutDeleteAppender( new PatternLayout("%m%n"), dataDir.getPath() + "/auditLog.log"); appender.setMaximumFileSize(10); sentryLogger.addAppender(appender); sentryLogger.debug("1111111111"); Thread.sleep(500); sentryLogger.debug("2222222222"); Thread.sleep(500); sentryLogger.debug("33333333"); File[] files = dataDir.listFiles(); assertNotNull(files); assertEquals(3, files.length); for (int i = 0; i < files.length; i++) { assertTrue(files[i].getName().matches("auditLog\\.log\\.\\d+")); } }