From bc0880711b2e5da4b260e158b85ec24341fe061d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 4 Oct 2016 10:18:14 +0200 Subject: [PATCH] Log full stack trace on socket connection errors when debug logging Might help bring some clarity for #1523 --- src/octoprint/server/util/sockjs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/octoprint/server/util/sockjs.py b/src/octoprint/server/util/sockjs.py index 0554f346..7564d5c1 100644 --- a/src/octoprint/server/util/sockjs.py +++ b/src/octoprint/server/util/sockjs.py @@ -203,4 +203,7 @@ class PrinterStateConnection(sockjs.tornado.SockJSConnection, octoprint.printer. try: self.send({type: payload}) except Exception as e: - self._logger.warn("Could not send message to client %s: %s" % (self._remoteAddress, str(e))) + if self._logger.isEnabledFor(logging.DEBUG): + self._logger.exception("Could not send message to client {}".format(self._remoteAddress)) + else: + self._logger.warn("Could not send message to client {}: {}".format(self._remoteAddress, e))