code: synchronized public void flushRecordsToLogFile(SessionId sessionId,
        List<LogRecord> records) throws IOException {
      LogFile logFile = sessionToLogFileMap.get(sessionId);
  
      if (logFile == null) {
        createLogFileAndAddToMap(sessionId);
        logFile = sessionToLogFileMap.get(sessionId);
      }
  
      logFile.openLogWriter();
      for (LogRecord record : records) {
        logFile.getLogWriter().writeObject(record);
      }
      logFile.closeLogWriter();
    }
docs: This creates a mapping between session and file representation of logs if doesnt exist already.
  Writes the log records to the log file. This does *NOT* flush the logs to file. This does *NOT*
  clear the records after writing to file.
  
  @param sessionId session-id to which the log records belong
  @param records logRecords that need to be stored
  @throws IOException file i/o exception can occur because of a temp file created