Skip to content

Commit 75e2e0f

Browse files
committed
loadtest-controller: improve logging
1 parent 6888ddb commit 75e2e0f

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

loadtest-controller/src/main/java/io/openvidu/loadtest/monitoring/ElasticSearchClient.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ public void init() {
8383
log.info("Connection to Elasticsearch established at {}", elasticsearchHost);
8484
}
8585
} catch (Exception e) {
86-
throw new LoadTestInitializationException(
87-
"Connection to Elasticsearch failed at " + loadTestConfig.getElasticsearchHost()
88-
+ " (" + e.getMessage()
89-
+ "). If property 'ELASTICSEARCH_HOST' is defined, then it is mandatory that OpenVidu Load Test is able to connect to it",
90-
e);
86+
String message = "Connection to Elasticsearch failed at " + loadTestConfig.getElasticsearchHost()
87+
+ " (" + e.getMessage()
88+
+ "). If property 'ELASTICSEARCH_HOST' is defined, then it is mandatory that OpenVidu Load Test is able to connect to it";
89+
log.error(message);
90+
throw new LoadTestInitializationException(message, e);
9191
}
9292
}
9393

loadtest-controller/src/main/java/io/openvidu/loadtest/services/BrowserEmulatorClient.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,11 @@ public void ping(String workerUrl) {
139139
Thread.currentThread().interrupt();
140140
log.error("Ping interrupted: {}", e.getMessage());
141141
} catch (Exception e) {
142-
log.error(e.getMessage());
142+
if (e.getMessage() != null) {
143+
log.error(e.getMessage());
144+
} else {
145+
log.debug("Error doing ping", e);
146+
}
143147
log.error("Error doing ping. Retry...");
144148
ping(workerUrl);
145149
}

0 commit comments

Comments
 (0)