private LogEvent findLogEventContaining(final String logMessage) {
    List<LogEvent> logEvents = listAppender.getEvents();
    for (LogEvent logEvent : logEvents) {
      if (logEvent.getMessage().getFormattedMessage().contains(logMessage)) {
        return logEvent;
      }
    }
    return null;
  }
Integration tests for {@link Cache} with custom {@code log4j2.xml}.
geode-log4j/src/integrationTest/java/org/apache/geode/logging/log4j/internal/impl/CacheWithCustomLogConfigIntegrationTest.java