summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
Diffstat (limited to 'synapse')
-rw-r--r--synapse/federation/transaction_queue.py12
-rw-r--r--synapse/handlers/federation.py10
2 files changed, 22 insertions, 0 deletions
diff --git a/synapse/federation/transaction_queue.py b/synapse/federation/transaction_queue.py
index dab4a7c8c4..f3edfc60ed 100644
--- a/synapse/federation/transaction_queue.py
+++ b/synapse/federation/transaction_queue.py
@@ -15,6 +15,7 @@
 import datetime
 import logging
 import string
+import json
 
 from six import itervalues
 
@@ -43,6 +44,8 @@ from .units import Edu, Transaction
 
 logger = logging.getLogger(__name__)
 
+pdu_logger = logging.getLogger("synapse.federation.pdu_destination_logger")
+
 sent_pdus_destination_dist_count = Counter(
     "synapse_federation_client_sent_pdu_destinations:count", ""
 )
@@ -261,6 +264,15 @@ class TransactionQueue(object):
         destinations.discard(self.server_name)
         logger.debug("Sending to: %s", str(destinations))
 
+        pdu_logger.info(
+            "SendingPDU",
+            extra={
+                "event_id": pdu.event_id, "room_id": pdu.room_id,
+                "destinations": json.dumps(list(destinations)),
+                "server": self.server_name,
+            },
+        )
+
         if not destinations:
             return
 
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index c07ba171e3..b16097caa2 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -68,6 +68,7 @@ from ._base import BaseHandler
 
 logger = logging.getLogger(__name__)
 
+pdu_logger = logging.getLogger("synapse.federation.pdu_destination_logger")
 
 def shortstr(iterable, maxitems=5):
     """If iterable has maxitems or fewer, return the stringification of a list
@@ -176,6 +177,15 @@ class FederationHandler(BaseHandler):
                 or pdu.internal_metadata.is_outlier()
             )
         )
+        pdu_logger.info(
+            "ReceivedPDU",
+            extra={
+                "event_id": pdu.event_id, "room_id": pdu.room_id,
+                "origin": origin, "already_seen": already_seen,
+                "server": self.server_name,
+            },
+        )
+
         if already_seen:
             logger.debug("[%s %s]: Already seen pdu", room_id, event_id)
             return