static List<File> getLogFiles(final String dirName) {
    List<File> result = new ArrayList<>();

    File dir = new File(dirName);
    File[] names = dir.listFiles();
    if (names != null) {
      for (final File name : names) {
        String path = name.getAbsolutePath();
        if (path.endsWith(".log") || path.endsWith(".log.gz")) {
          result.add(name);
        }
      }
    }
    return result;
  }
Find all of the .log files in the given directory

@param dirName directory to search
@return all of the .log files found (Files)
geode-core/src/main/java/org/apache/geode/internal/logging/MergeLogFiles.java