@Test
  public void loggerWarnMessageIsLogged() {
    logger.warn(warnMessage);

    LogEvent logEvent = findLogEventContaining(warnMessage);
    assertThat(logEvent).as(logEventContaining(warnMessage)).isNotNull();
    assertThat(logEvent.getLoggerName()).isEqualTo(logger.getName());
    assertThat(logEvent.getLevel()).isEqualTo(Level.WARN);
    assertThat(logEvent.getMessage().getFormattedMessage()).isEqualTo(warnMessage);
  }
Integration tests for {@link Cache} with custom {@code log4j2.xml}.
geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/CacheWithCustomLogConfigIntegrationTest.java