Skip to content

Commit 97e89ad

Browse files
authored
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
1 parent be6bdab commit 97e89ad

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ private void logFileContents(String description, Path from) {
288288
logger.error("{} `{}`", description, this);
289289
try(Stream<String> lines = Files.lines(from, StandardCharsets.UTF_8)) {
290290
lines
291-
.map(line -> " [" + name + "]" + line)
291+
.map(line -> " " + line)
292292
.forEach(logger::error);
293293
} catch (IOException e) {
294294
throw new UncheckedIOException(e);

buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/TestClustersPlugin.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@ private static void shutdownExecutorService() {
332332
}
333333

334334
private static void shutDownAllClusters() {
335-
logger.info("Shutting down all test clusters", new RuntimeException());
335+
if (logger.isDebugEnabled()) {
336+
logger.debug("Shutting down all test clusters", new RuntimeException());
337+
}
336338
synchronized (runningClusters) {
337339
runningClusters.forEach(each -> each.stop(true));
338340
runningClusters.clear();

0 commit comments

Comments
 (0)