summary refs log tree commit diff
path: root/synapse/logging/utils.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-09-08 14:52:51 +0100
committerGitHub <noreply@github.com>2020-09-08 14:52:51 +0100
commit703e2b8a960a0845a5fbe14c34c45ae802300a4d (patch)
tree432acb98e68cf0ee5a9d3dbd52da9713413c63e7 /synapse/logging/utils.py
parentFix `MultiWriterIdGenerator.current_position`. (#8257) (diff)
downloadsynapse-703e2b8a960a0845a5fbe14c34c45ae802300a4d.tar.xz
Use the right constructor for log records (#8278)
Update `log_function` to use the right factory to create log records, to make
sure that they have `request` attributes.

Fixes: #8267.
Diffstat (limited to '')
-rw-r--r--synapse/logging/utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/logging/utils.py b/synapse/logging/utils.py
index fea774e2e5..becf66dd86 100644
--- a/synapse/logging/utils.py
+++ b/synapse/logging/utils.py
@@ -29,11 +29,11 @@ def _log_debug_as_f(f, msg, msg_args):
         lineno = f.__code__.co_firstlineno
         pathname = f.__code__.co_filename
 
-        record = logging.LogRecord(
+        record = logger.makeRecord(
             name=name,
             level=logging.DEBUG,
-            pathname=pathname,
-            lineno=lineno,
+            fn=pathname,
+            lno=lineno,
             msg=msg,
             args=msg_args,
             exc_info=None,