@Override
  public void stop() {
    System.out.println(String.format("Shutting down the %s...", getName()));
    if (transferThread != null) {
      transferThread.interrupt();
      try {
        transferThread.join();
      } catch (InterruptedException e) {
        System.err.println("Interrupted while waiting for transfer thread to finish." + e);
        Thread.currentThread().interrupt();
      }
    }

    flushSystemProducer();
    if (systemProducer != null) {
      systemProducer.stop();
    }
  }
If async-Logger is enabled, the log-event is sent directly to the systemProducer. Else, the event is serialized
and added to a bounded blocking queue, before returning to the "synchronous" caller.
@param event the log event to append
@throws InterruptedException
samza-log4j2/src/main/java/org/apache/samza/logging/log4j2/StreamAppender.java