summary refs log tree commit diff
path: root/synapse/storage/database.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2022-06-30 10:43:24 +0200
committerGitHub <noreply@github.com>2022-06-30 10:43:24 +0200
commit4d3b8fb23f0c9288b311efd7def83b641bda82b8 (patch)
treea9e78ae9ffabd1e4302da52b79712d244e48ef7f /synapse/storage/database.py
parentImplement MSC3827: Filtering of `/publicRooms` by room type (#13031) (diff)
downloadsynapse-4d3b8fb23f0c9288b311efd7def83b641bda82b8.tar.xz
Don't actually one-line the SQL statements we send to the DB (#13129)
Diffstat (limited to 'synapse/storage/database.py')
-rw-r--r--synapse/storage/database.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py
index e8c63cf567..e21ab08515 100644
--- a/synapse/storage/database.py
+++ b/synapse/storage/database.py
@@ -366,10 +366,11 @@ class LoggingTransaction:
         *args: P.args,
         **kwargs: P.kwargs,
     ) -> R:
-        sql = self._make_sql_one_line(sql)
+        # Generate a one-line version of the SQL to better log it.
+        one_line_sql = self._make_sql_one_line(sql)
 
         # TODO(paul): Maybe use 'info' and 'debug' for values?
-        sql_logger.debug("[SQL] {%s} %s", self.name, sql)
+        sql_logger.debug("[SQL] {%s} %s", self.name, one_line_sql)
 
         sql = self.database_engine.convert_param_style(sql)
         if args:
@@ -389,7 +390,7 @@ class LoggingTransaction:
                 "db.query",
                 tags={
                     opentracing.tags.DATABASE_TYPE: "sql",
-                    opentracing.tags.DATABASE_STATEMENT: sql,
+                    opentracing.tags.DATABASE_STATEMENT: one_line_sql,
                 },
             ):
                 return func(sql, *args, **kwargs)