public void redirectInternalJavaLoggers() {
    // Do we need to this on re-connect?
    LogManager logManager = LogManager.getLogManager();

    try {
      Enumeration<String> loggerNames = logManager.getLoggerNames();

      while (loggerNames.hasMoreElements()) {
        String loggerName = loggerNames.nextElement();
        if (loggerName.startsWith("java.") || loggerName.startsWith("javax.")) {
          Logger javaLogger = logManager.getLogger(loggerName);
          /*
           * From Java Docs: It is also important to note that the Logger associated with the String
           * name may be garbage collected at any time if there is no strong reference to the
           * Logger. The caller of this method must check the return value for null in order to
           * properly handle the case where the Logger has been garbage collected.
           */
          if (javaLogger != null) {
            gfshFileLogger.setParentFor(javaLogger);
          }
        }
      }
    } catch (SecurityException e) {
      gfshFileLogger.warning(e.getMessage(), e);
    }
  }
This method sets the parent of all loggers whose name starts with "java" or "javax" to
LogWrapper.

logWrapper disables any parents's log handler, and only logs to the file if specified. This
would prevent JDK's logging show up in the console
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/shell/Gfsh.java