code: @Override
    protected void subAppend(LoggingEvent event) {
      super.subAppend(event);
      // That should've gone into our writer. Notify the LogContext.
      String logOutput = writer.toString();
      writer.reset();
  
      OperationLog log = operationManager.getOperationLogByThread();
      if (log == null) {
        LOG.debug(" ---+++=== Dropped log event from thread " + event.getThreadName());
        return;
      }
      log.writeOperationLog(logOutput);
    }
docs: Overrides WriterAppender.subAppend(), which does the real logging. No need
  to worry about concurrency since log4j calls this synchronously.