summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-02-18 15:11:04 +0000
committerErik Johnston <erik@matrix.org>2019-02-18 15:11:04 +0000
commitfe725f7e452363e60cb0daf8ef55af603adaa0df (patch)
treed22285987261deb3b9063a0f5bbc110e3c8bebba /synapse/http
parentMerge pull request #4643 from matrix-org/erikj/catch_exceptions (diff)
downloadsynapse-fe725f7e452363e60cb0daf8ef55af603adaa0df.tar.xz
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.
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/server.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py
index 6a427d96a6..6c67a25a11 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