private static void initializeGfshStatics(Logger logger, Handler handler)
      throws NoSuchFieldException, IllegalAccessException {
    // Null out static instance so can reinitialise
    Field gfsh_instance = Gfsh.class.getDeclaredField("instance");
    gfsh_instance.setAccessible(true);
    gfsh_instance.set(null, null);

    LogWrapper gfshFileLogger = LogWrapper.getInstance(null);
    Field logWrapper_INSTANCE = LogWrapper.class.getDeclaredField("INSTANCE");
    logWrapper_INSTANCE.setAccessible(true);
    logWrapper_INSTANCE.set(null, gfshFileLogger);

    Field logWrapper_logger = LogWrapper.class.getDeclaredField("logger");
    logWrapper_logger.setAccessible(true);
    logger.addHandler(handler);
    logWrapper_logger.set(gfshFileLogger, logger);
  }
Restore logging to state prior to the execution of this class
geode-gfsh/src/integrationTest/java/org/apache/geode/management/internal/cli/shell/GfshInitFileIntegrationTest.java