private Message subAppend(LogEvent event) {
    if (getLayout() == null) {
      return new SimpleMessage(event.getMessage().getFormattedMessage());
    } else {
      Object obj = getLayout().toSerializable(event);
      if (obj instanceof Message) {
        return new SimpleMessage(((Message) obj).getFormattedMessage());
      } else if (obj instanceof LogEvent) {
        return new SimpleMessage(((LogEvent) obj).getMessage().getFormattedMessage());
      } else {
        return new SimpleMessage(obj.toString());
      }
    }
  }
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