@Test
  public void logFileContainsBannerOnlyOnce() {
    locatorVM.invoke(() -> {
      assertThat(system.getDistributionManager().getDistributionManagerIds()).hasSize(3);
    });

    server2VM.invoke(() -> {
      Distribution membershipManager = getDistribution(system);
      ((GMSMembership<InternalDistributedMember>) membershipManager.getMembership())
          .forceDisconnect("Forcing disconnect in " + testName.getMethodName());

      await().until(() -> system.isReconnecting());
      system.waitUntilReconnected(TIMEOUT, MILLISECONDS);
      assertThat(system.getReconnectedSystem()).isNotSameAs(system);
    });

    locatorVM.invoke(() -> {
      assertThat(system.getDistributionManager().getDistributionManagerIds()).hasSize(3);
    });

    server2VM.invoke(() -> {
      File[] files = server2Dir.listFiles((dir, name) -> name.endsWith(".log"));
      assertThat(files).as(expectedOneLogFile(files)).hasSize(1);

      File logFile = files[0];
      assertThat(logFile).exists();

      // Banner must be logged only once
      LogFileAssert.assertThat(logFile).containsOnlyOnce(displayValues());

      // Startup Config must be logged only once
      String[] startupConfiguration = StringUtils
          .split(STARTUP_CONFIGURATION + lineSeparator() + system.getConfig().toLoggerString(),
              lineSeparator());

      LogFileAssert.assertThat(logFile).containsOnlyOnce(startupConfiguration);
    });
  }
Distributed tests for logging during reconnect.
geode-core/src/distributedTest/java/org/apache/geode/logging/internal/LoggingWithReconnectDistributedTest.java