Module: check_mk
Branch: master
Commit: 61e969435943719d5b71dca7b84e9e4fe0fb4951
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=61e96943594371…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Wed May 9 09:22:55 2018 +0200
Do not log stack traces for client errors.
Change-Id: I9d978fff40cf275a0c637dd5b2296e85ad12550e
---
cmk/ec/main.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/cmk/ec/main.py b/cmk/ec/main.py
index 8c0a512..df74d36 100644
--- a/cmk/ec/main.py
+++ b/cmk/ec/main.py
@@ -3632,7 +3632,12 @@ class StatusServer(ECServerThread):
self._perfcounters.count_time("request", duration)
except Exception as e:
- self.logger.exception("Error handling client %s: %s" %
(addr_info, e))
+ msg = "Error handling client %s: %s" % (addr_info, e)
+ # Do not log a stack trace for client errors, they are not *our* fault.
+ if isinstance(e, MKClientError):
+ self.logger.error(msg)
+ else:
+ self.logger.exception(msg)
if client_socket:
client_socket.close()
client_socket = None