@Override
  public void append(LogEvent event) {
    try {
      if (!systemInitialized) {
        // configs are needed to set up producer system, so check that before actually initializing
        if (this.loggingContextHolder.getConfig() != null) {
          if (setUpSystemLock.tryLock(SET_UP_SYSTEM_TIMEOUT_MILLI_SECONDS, TimeUnit.MILLISECONDS)) {
            try {
              if (!systemInitialized) {
                setupSystem();
                systemInitialized = true;
              }
              handleEvent(event);
            } finally {
              setUpSystemLock.unlock();
            }
          } else {
            // skip sending the log to the stream if setupStream timeout in 10s
            System.out.println("Waiting for another thread to setupStream before log can be handled");
          }
        } else {
          // skip sending the log to the stream if initialization can't happen yet
          System.out.println("Waiting for config to become available before log can be handled");
        }
      } else {
        handleEvent(event);
      }
    } catch (Exception e) {
      if (metrics != null) { // setupSystem() may not have been invoked yet so metrics can be null here.
        metrics.logMessagesErrors.inc();
      }
      System.err.println(String.format("[%s] Error sending log message:", getName()));
      e.printStackTrace();
    }
  }
Setter for the number of partitions to create on a new StreamAppender stream. See also {@link #createAppender(String, Filter, Layout, boolean, boolean, String)} for when this is called.
Example: {@literal <param name="PartitionCount" value="4"/>}
@param partitionCount Configurable partition count.
samza-log4j2/src/main/java/org/apache/samza/logging/log4j2/StreamAppender.java