@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("123456789012345"); File[] files = dataDir.listFiles(); if (files != null) { assertEquals(files.length, 2); assertTrue(files[0].getName().contains("auditLog.log.")); assertTrue(files[1].getName().contains("auditLog.log.")); } else { fail("Excepted 2 log files."); } }
public void setMaximumFileSize(long maxFileSize) { this.maxFileSize = maxFileSize; }
RollingFileWithoutDeleteAppender extends FileAppender { public void setMaximumFileSize(long maxFileSize) { this.maxFileSize = maxFileSize; } }
RollingFileWithoutDeleteAppender extends FileAppender { public void setMaximumFileSize(long maxFileSize) { this.maxFileSize = maxFileSize; } RollingFileWithoutDeleteAppender();  RollingFileWithoutDeleteAppender(Layout layout, String filename,
      boolean append);  RollingFileWithoutDeleteAppender(Layout layout, String filename); }
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); }
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);  }