@Override
  public void uncaughtException(final Thread t, final Throwable ex) {
    synchronized (dispatchLock) {
      if (ex instanceof VirtualMachineError) {
        SystemFailure.setFailure((VirtualMachineError) ex); // don't throw
      }
      // Solution to treat the shutdown hook error as a special case.
      // Do not change the hook's thread name without also changing it here.
      String threadName = t.getName();
      if ((ex instanceof NoClassDefFoundError)
          && (threadName.equals(InternalDistributedSystem.SHUTDOWN_HOOK_NAME))) {
        final String msg =
            "Uncaught exception in thread %s this message can be disregarded if it occurred during an Application Server shutdown. The Exception message was: %s";
        final Object[] msgArgs = new Object[] {t, ex.getLocalizedMessage()};
        stderr.info(String.format(msg, msgArgs));
        if (logger != null) {
          logger.info(String.format(msg, msgArgs));
        }
        if (logWriter != null) {
          logWriter.info(String.format(msg, msgArgs));
        }
      } else {
        stderr.severe(String.format("Uncaught exception in thread %s", t), ex);
        if (logger != null) {
          logger.fatal(String.format("Uncaught exception in thread %s", t), ex);
        }
        if (logWriter != null) {
          logWriter.severe(String.format("Uncaught exception in thread %s", t), ex);
        }
      }
      uncaughtExceptionsCount++;
    }
  }
Logs an uncaught exception to a log writer
geode-core/src/main/java/org/apache/geode/internal/logging/LoggingThreadGroup.java