code: private void printErrors(){
          if (errorLog.isFile()){
              FileReader fileReader;
              try {
                  fileReader = new FileReader(errorLog);
                  BufferedReader bufferedReader = new BufferedReader(fileReader);
                  String currLine;
                  while ((currLine = bufferedReader.readLine()) != null){
                      logger.debug(currLine);
                  }
                  fileReader.close();
              } catch (Exception e) {
                  logger.warn("Error printing cmd command errors {} " , e.getMessage());
                  logger.debug("Error: {}", e.getStackTrace());
              } finally {
                  try {
                      FileUtils.forceDelete(errorLog);
                  } catch (IOException e) {
                      logger.warn("Error closing cmd command errors file {} " , e.getMessage());
                      logger.debug("Error: {}", e.getStackTrace());
                  }
              }
          }
      }
docs: if you find a better way - go ahead and replace it