From fe725f7e452363e60cb0daf8ef55af603adaa0df Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 18 Feb 2019 15:11:04 +0000 Subject: [PATCH 1/2] Cleanup top level request exception logging Firstly, we always logged that the request was being handled via `JsonResource._async_render`, so we change that to use the servlet name we add to the request. Secondly, we pass the exception information to the logger rather than formatting it manually. This makes it consistent with other exception logging, allwoing logging hooks and formatters to access the exception information. --- synapse/http/server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/synapse/http/server.py b/synapse/http/server.py index 6a427d96a..6c67a25a1 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py @@ -106,10 +106,10 @@ def wrap_json_request_handler(h): # trace. f = failure.Failure() logger.error( - "Failed handle request via %r: %r: %s", - h, + "Failed handle request via %r: %r", + request.request_metrics.name, request, - f.getTraceback().rstrip(), + exc_info=(f.type, f.value, f.getTracebackObject()), ) # Only respond with an error response if we haven't already started # writing, otherwise lets just kill the connection From 12ae64ce0d23f76dd19a27f3a754f37a82253496 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 18 Feb 2019 15:23:10 +0000 Subject: [PATCH 2/2] Newsfile --- changelog.d/4669.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/4669.misc diff --git a/changelog.d/4669.misc b/changelog.d/4669.misc new file mode 100644 index 000000000..00a1a940a --- /dev/null +++ b/changelog.d/4669.misc @@ -0,0 +1 @@ +Cleanup request exception logging