code: public void close() {
        closed = true;
        //
        //    close all attached appenders.
        //
        synchronized (appenders) {
          Enumeration iter = appenders.getAllAppenders();
  
          if (iter != null) {
            while (iter.hasMoreElements()) {
              Object next = iter.nextElement();
  
              if (next instanceof Appender) {
                ((Appender) next).close();
              }
            }
          }
        }
      }
docs: Close this <code>AsyncAppender</code> by interrupting the dispatcher
  thread which will process all pending events before exiting.