code: private void removeOldLogs()
    {
      try {
        Path path = getPath();
        Path parent = path.getParent();
  
        ArrayList<String> matchList = new ArrayList<String>();
  
        Pattern archiveRegexp = getArchiveRegexp();
        Files.list(parent).forEach(child->{
          String subPath = child.getFileName().toString();
          
          Matcher matcher = archiveRegexp.matcher(subPath);
  
          if (matcher.matches())
            matchList.add(subPath);
        });
  
        Collections.sort(matchList);
  
        if (_rolloverCount <= 0 || matchList.size() < _rolloverCount)
          return;
  
        for (int i = 0; i + _rolloverCount < matchList.size(); i++) {
          try {
            Files.delete(parent.resolve(matchList.get(i)));
          } catch (Throwable e) {
          }
        }
      } catch (Throwable e) {
      }
    }
docs: Removes logs passing the rollover count.