code: private void setupOutputStream() {
      synchronized (failureLogFile) {
        // Setup is done by some thread
        if (hasSetupOutputStream) {
          return;
        }
  
        try {
          boolean append = false;
          if (fs.exists(failureLogFile)) {
            log.info("Failure log file %s already exists, appending to it", failureLogFile);
            append = true;
          }
          OutputStream outputStream = append ? fs.append(failureLogFile) : fs.create(failureLogFile);
          output = this.closer.register(new PrintStream(outputStream, false, Charsets.UTF_8.toString()));
        } catch (IOException e) {
          throw new RuntimeException(e);
        } finally {
          hasSetupOutputStream = true;
        }
      }
    }
docs: Set up the {@link OutputStream} to the {@link #failureLogFile} only once