From 38adf14998d2f727d689cfcfc7363aac52aaff9f Mon Sep 17 00:00:00 2001 From: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Date: Fri, 25 Mar 2022 14:44:57 +0000 Subject: [PATCH] Enhance logging for inbound federation events (#12301) It is currently rather hard to see which rooms are causing inbound federation traffic. Add the room id to the logs. --- changelog.d/12301.misc | 1 + synapse/federation/federation_server.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/12301.misc diff --git a/changelog.d/12301.misc b/changelog.d/12301.misc new file mode 100644 index 0000000000..a4cd94ee5e --- /dev/null +++ b/changelog.d/12301.misc @@ -0,0 +1 @@ +Enhance logging for inbound federation events. diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py index af2d0f7d79..c7400c737b 100644 --- a/synapse/federation/federation_server.py +++ b/synapse/federation/federation_server.py @@ -1092,7 +1092,7 @@ class FederationServer(FederationBase): # has started processing). while True: async with lock: - logger.info("handling received PDU: %s", event) + logger.info("handling received PDU in room %s: %s", room_id, event) try: with nested_logging_context(event.event_id): await self._federation_event_handler.on_receive_pdu(