private static void addSuspectFileAppender(final String workspaceDir) {
    final String suspectFilename = createDunitSuspectFile(DUnitEnv.get().getId(), workspaceDir)
        .getAbsolutePath();

    Object mainLogger = LogManager.getLogger(LoggingProvider.MAIN_LOGGER_NAME);
    if (!(mainLogger instanceof org.apache.logging.log4j.core.Logger)) {
      System.err.format(
          "Unable to configure suspect file appender - cannot retrieve LoggerContext from type: %s\n",
          mainLogger.getClass().getName());
      return;
    }

    final LoggerContext appenderContext =
        ((org.apache.logging.log4j.core.Logger) mainLogger).getContext();

    final PatternLayout layout = PatternLayout.createLayout(
        "[%level{lowerCase=true} %date{yyyy/MM/dd HH:mm:ss.SSS z} <%thread> tid=%tid] %message%n%throwable%n",
        null, null, null, Charset.defaultCharset(), true, false, "", "");

    final FileAppender fileAppender = FileAppender.createAppender(suspectFilename, "true", "false",
        DUnitLauncher.class.getName(), "true", "false", "false", "0", layout, null, null, null,
        appenderContext.getConfiguration());
    fileAppender.start();

    LoggerConfig loggerConfig =
        appenderContext.getConfiguration().getLoggerConfig(LoggingProvider.MAIN_LOGGER_NAME);
    loggerConfig.addAppender(fileAppender, Level.INFO, null);
  }
Add an appender to Log4j which sends all INFO+ messages to a separate file which will be used
later to scan for suspect strings. The pattern of the messages conforms to the original log
format so that hydra will be able to parse them.
geode-dunit/src/main/java/org/apache/geode/test/dunit/internal/DUnitLauncher.java