Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GEODE-6707 gfsh export logs will now export rolled over gc logs #3543

Merged
merged 3 commits into from May 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -134,4 +134,18 @@ public void findStatFiles() throws Exception {
assertThat(logExporter.findStatFiles(workingDir.toPath())).contains(statFile.toPath());
assertThat(logExporter.findStatFiles(workingDir.toPath())).doesNotContain(notALogFile.toPath());
}

@Test
// GEODE-6707 - Rolled over GC logs end with names like ".log.1"
public void findLogsWhichContainsTheWordLog() throws Exception {
File gcLogFile = new File(workingDir, "gc.log");
FileUtils.writeStringToFile(gcLogFile, "some gc log line");

File gcRolledOverLogFile = new File(workingDir, "gc.log.1");
FileUtils.writeStringToFile(gcRolledOverLogFile, "some gc log line");

assertThat(logExporter.findLogFiles(workingDir.toPath())).contains(gcLogFile.toPath());
assertThat(logExporter.findLogFiles(workingDir.toPath()))
.contains(gcRolledOverLogFile.toPath());
}
}
Expand Up @@ -169,7 +169,7 @@ private long filterAndSize(Path originalLogFile) throws IOException {
}

List<Path> findLogFiles(Path workingDir) throws IOException {
Predicate<Path> logFileSelector = (Path file) -> file.toString().toLowerCase().endsWith(".log");
Predicate<Path> logFileSelector = (Path file) -> file.toString().toLowerCase().contains(".log");
return findFiles(workingDir, logFileSelector);
}

Expand Down