mirror of
https://github.com/danieldemus/openhab-core.git
synced 2026-07-29 12:34:22 +02:00
Avoid stack overflow - don't log a message within the log handler (#4556)
* Avoid stack overflow - don't log a message within the log handler Signed-off-by: Chris Jackson <chris@cd-jackson.com> * Don't log error Signed-off-by: Chris Jackson <chris@cd-jackson.com> --------- Signed-off-by: Chris Jackson <chris@cd-jackson.com>
This commit is contained in:
+1
-2
@@ -113,7 +113,6 @@ public class LogWebSocket implements LogListener {
|
||||
private synchronized void sendMessage(String message) throws IOException {
|
||||
RemoteEndpoint remoteEndpoint = this.remoteEndpoint;
|
||||
if (remoteEndpoint == null) {
|
||||
logger.warn("Could not determine remote endpoint, failed to send '{}'.", message);
|
||||
return;
|
||||
}
|
||||
remoteEndpoint.sendString(message);
|
||||
@@ -128,7 +127,7 @@ public class LogWebSocket implements LogListener {
|
||||
LogDTO logDTO = map(logEntry);
|
||||
sendMessage(gson.toJson(logDTO));
|
||||
} catch (IOException e) {
|
||||
logger.debug("Failed to send log {} to {}: {}", logEntry, remoteIdentifier, e.getMessage());
|
||||
// Fail silently!
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user