From 860ce811dc516112429acb9d0e9be16016aa4a61 Mon Sep 17 00:00:00 2001 From: kaslo Date: Sat, 20 Dec 2025 04:31:19 +0000 Subject: [PATCH] fix: remove timestamp rounding in TerseJsonFormatter The round(record.created, 2) call limits timestamps generated by TerseJsonFormatter to 10ms precision. This can cause log ordering issues in log aggregators like Loki when multiple events occur within the same 10ms window. The rounding was introduced in the original structured logging PR and, to my knowledge, has no technical benefit. --- synapse/logging/_terse_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/logging/_terse_json.py b/synapse/logging/_terse_json.py index d9ff70b252..5afa4c5fa9 100644 --- a/synapse/logging/_terse_json.py +++ b/synapse/logging/_terse_json.py @@ -89,7 +89,7 @@ class TerseJsonFormatter(JsonFormatter): "log": record.getMessage(), "namespace": record.name, "level": record.levelname, - "time": round(record.created, 2), + "time": record.created, } return self._format(record, event)