code: private void transferLogFilesToS3() {
          if (_fileTransfersEnabled) {
              // Find all closed log files in the staging directory and move them to S3
              for (final File logFile : _stagingDir.listFiles((dir, name) -> name.startsWith(_logFilePrefix) && name.endsWith(COMPRESSED_FILE_SUFFIX))) {
                  // Extract the date portion of the file name and is it to partition the file in S3
                  String auditDate = logFile.getName().substring(_logFilePrefix.length() + 1, _logFilePrefix.length() + 9);
                  String dest = String.format("%s/date=%s/%s", _s3AuditRoot, auditDate, logFile.getName());
  
                  _fileTransferService.submit(() -> {
                      // Since file transfers are done in a single thread, there shouldn't be any concurrency issues,
                      // but verify the same file wasn't submitted previously and is already transferred.
                      if (logFile.exists()) {
                          try {
                              PutObjectResult result = _s3.putObject(_s3Bucket, dest, logFile);
                              _log.debug("Audit log copied: {}, ETag={}", logFile, result.getETag());
  
                              if (!logFile.delete()) {
                                  _log.warn("Failed to delete file after copying to s3: {}", logFile);
                              }
                          } catch (Exception e) {
  
                              // Log the error, try again on the next iteration
                              _rateLimitedLog.error(e, "Failed to copy log file {}", logFile);
                          }
                      }
                  });
              }
          }
  
      }
docs: This method takes all log files prepared by {@link #prepareClosedLogFilesForTransfer()} and initiates their
  transfer to S3.  The transfer itself is performed asynchronously.