code: @Override
    public void append(Transaction txn) throws IOException {
      if (this.lastSeenZxid.compareTo(txn.getZxid()) >= 0) {
        String exStr = String.format("The zxid %s is not larger than last seen"
            + " zxid %s in the log.", txn.getZxid(), lastSeenZxid);
        throw new RuntimeException(exStr);
      }
      if (currentLog == null || currentLog.length() >= this.rollingSize) {
        Zxid zxid = txn.getZxid();
        // Close the old one if any.
        this.close();
        File logFile = new File(logDir, "transaction." + zxid.toSimpleString());
        LOG.debug("Rolling to the new log {}.", logFile.getName());
        // Adds new created log file to list.
        this.logFiles.add(logFile);
        this.currentLog = new SimpleLog(logFile);
      }
      this.lastSeenZxid = txn.getZxid();
      this.currentLog.append(txn);
    }
docs: Appends a request to transaction log.
  
  @param txn the transaction which will be added to log.
  @throws IOException in case of IO failure