summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-05-22 14:33:11 +0100
committerErik Johnston <erik@matrix.org>2015-05-22 14:44:02 +0100
commite70e8e053e2d44d0f7cebe3bee7b4afbe103f0a7 (patch)
tree6292490ae71efe08d4e4a86aa72a41703526c2d8 /synapse
parentLog less lines at INFO level, but include more helpful information (diff)
downloadsynapse-e70e8e053e2d44d0f7cebe3bee7b4afbe103f0a7.tar.xz
Add txn_id to some log lines
Diffstat (limited to 'synapse')
-rw-r--r--synapse/federation/transaction_queue.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/synapse/federation/transaction_queue.py b/synapse/federation/transaction_queue.py
index afe71897f9..32fa5e8c15 100644
--- a/synapse/federation/transaction_queue.py
+++ b/synapse/federation/transaction_queue.py
@@ -242,6 +242,8 @@ class TransactionQueue(object):
         try:
             self.pending_transactions[destination] = 1
 
+            txn_id = str(self._next_txn_id)
+
             limiter = yield get_retry_limiter(
                 destination,
                 self._clock,
@@ -249,9 +251,9 @@ class TransactionQueue(object):
             )
 
             logger.debug(
-                "TX [%s] Attempting new transaction"
+                "TX [%s] {%s} Attempting new transaction"
                 " (pdus: %d, edus: %d, failures: %d)",
-                destination,
+                destination, txn_id,
                 len(pending_pdus),
                 len(pending_edus),
                 len(pending_failures)
@@ -261,7 +263,7 @@ class TransactionQueue(object):
 
             transaction = Transaction.create_new(
                 origin_server_ts=int(self._clock.time_msec()),
-                transaction_id=str(self._next_txn_id),
+                transaction_id=txn_id,
                 origin=self.server_name,
                 destination=destination,
                 pdus=pdus,
@@ -275,9 +277,9 @@ class TransactionQueue(object):
 
             logger.debug("TX [%s] Persisted transaction", destination)
             logger.info(
-                "TX [%s] Sending transaction [%s],"
+                "TX [%s] {%s} Sending transaction [%s],"
                 " (PDUs: %d, EDUs: %d, failures: %d)",
-                destination,
+                destination, txn_id,
                 transaction.transaction_id,
                 len(pending_pdus),
                 len(pending_edus),
@@ -317,7 +319,10 @@ class TransactionQueue(object):
                     code = e.code
                     response = e.response
 
-                logger.info("TX [%s] got %d response", destination, code)
+                logger.info(
+                    "TX [%s] {%s} got %d response",
+                    destination, txn_id, code
+                )
 
                 logger.debug("TX [%s] Sent transaction", destination)
                 logger.debug("TX [%s] Marking as delivered...", destination)