summary refs log tree commit diff
path: root/synapse/http/client.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-14 11:46:07 +0000
committerErik Johnston <erik@matrix.org>2014-11-14 11:46:07 +0000
commitb8eca1ffbf697b968acd0e3abc0341ca134dc6a0 (patch)
tree64b1eb1540f1eff147fb58ac9e85fc64920a49ad /synapse/http/client.py
parentUse modelService to access room member power levels rather than RoomController. (diff)
parentMerge branch 'develop' into request_logging (diff)
downloadsynapse-b8eca1ffbf697b968acd0e3abc0341ca134dc6a0.tar.xz
Merge pull request #13 from matrix-org/request_logging
Request logging
Diffstat (limited to 'synapse/http/client.py')
-rw-r--r--synapse/http/client.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py
index c34b086eb9..29e6053bc1 100644
--- a/synapse/http/client.py
+++ b/synapse/http/client.py
@@ -23,6 +23,7 @@ from twisted.web.http_headers import Headers
 
 from synapse.http.endpoint import matrix_endpoint
 from synapse.util.async import sleep
+from synapse.util.logcontext import PreserveLoggingContext
 
 from syutil.jsonutil import encode_canonical_json
 
@@ -108,16 +109,17 @@ class BaseHttpClient(object):
                 producer = body_callback(method, url_bytes, headers_dict)
 
             try:
-                response = yield self.agent.request(
-                    destination,
-                    endpoint,
-                    method,
-                    path_bytes,
-                    param_bytes,
-                    query_bytes,
-                    Headers(headers_dict),
-                    producer
-                )
+                with PreserveLoggingContext():
+                    response = yield self.agent.request(
+                        destination,
+                        endpoint,
+                        method,
+                        path_bytes,
+                        param_bytes,
+                        query_bytes,
+                        Headers(headers_dict),
+                        producer
+                    )
 
                 logger.debug("Got response to %s", method)
                 break