Testclusters logging improovements (#37354)

- Cluster logs are only indented as  node name is already in the logs
- silence logging on shutdown
- have fully qualified name as node and cluster name
This commit is contained in:
Alpar Torok 2019-01-25 14:13:34 +02:00 committed by GitHub
parent be6bdab346
commit 97e89ad0bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -288,7 +288,7 @@ public class ElasticsearchNode {
logger.error("{} `{}`", description, this); logger.error("{} `{}`", description, this);
try(Stream<String> lines = Files.lines(from, StandardCharsets.UTF_8)) { try(Stream<String> lines = Files.lines(from, StandardCharsets.UTF_8)) {
lines lines
.map(line -> " [" + name + "]" + line) .map(line -> " " + line)
.forEach(logger::error); .forEach(logger::error);
} catch (IOException e) { } catch (IOException e) {
throw new UncheckedIOException(e); throw new UncheckedIOException(e);

View File

@ -332,7 +332,9 @@ public class TestClustersPlugin implements Plugin<Project> {
} }
private static void shutDownAllClusters() { private static void shutDownAllClusters() {
logger.info("Shutting down all test clusters", new RuntimeException()); if (logger.isDebugEnabled()) {
logger.debug("Shutting down all test clusters", new RuntimeException());
}
synchronized (runningClusters) { synchronized (runningClusters) {
runningClusters.forEach(each -> each.stop(true)); runningClusters.forEach(each -> each.stop(true));
runningClusters.clear(); runningClusters.clear();