@Before
  public void setUp() {
    String name = testName.getMethodName();
    File mainLogFile = new File(temporaryFolder.getRoot(), name + ".log");
    securityLogFile = new File(temporaryFolder.getRoot(), name + "-security.log");

    LogConfig logConfig = mock(LogConfig.class);
    when(logConfig.getName()).thenReturn(name);
    when(logConfig.getLogFile()).thenReturn(mainLogFile);
    when(logConfig.getSecurityLogFile()).thenReturn(securityLogFile);

    LogConfigSupplier logConfigSupplier = mock(LogConfigSupplier.class);
    when(logConfigSupplier.getLogConfig()).thenReturn(logConfig);
    when(logConfigSupplier.getStatisticsConfig()).thenReturn(mock(StatisticsConfig.class));

    SessionContext sessionContext = mock(SessionContext.class);
    when(sessionContext.getLogConfigSupplier()).thenReturn(logConfigSupplier);

    mainGeodeLogger = LogService.getLogger(MAIN_LOGGER_NAME);
    securityGeodeLogger = LogService.getLogger(SECURITY_LOGGER_NAME);

    logMessage = "Logging in " + testName.getMethodName();

    mainLogWriterAppender = loggerContextRule.getAppender(MAIN_APPENDER_NAME,
        LogWriterAppender.class);
    securityLogWriterAppender = loggerContextRule.getAppender(SECURITY_APPENDER_NAME,
        LogWriterAppender.class);

    mainLogWriterAppender.createSession(sessionContext);
    mainLogWriterAppender.startSession();
    mainLogWriterAppender.clearLogEvents();

    securityLogWriterAppender.createSession(sessionContext);
    securityLogWriterAppender.startSession();
    securityLogWriterAppender.clearLogEvents();
  }
Integration tests for main and security {@link LogWriterAppender}s, loggers, and
{@link ConfigurationProperties#LOG_FILE} and {@link ConfigurationProperties#SECURITY_LOG_FILE}.
geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/BothLogWriterAppendersIntegrationTest.java