Log transactions being allocated 55/4555/1
authorRobert Varga <rovarga@cisco.com>
Wed, 22 Jan 2014 09:21:22 +0000 (10:21 +0100)
committerRobert Varga <rovarga@cisco.com>
Wed, 22 Jan 2014 09:27:28 +0000 (10:27 +0100)
We do get logs when the transaction processing starts, unfortunately we
do not get the context in which the transaction was created. This fixes
the deficiency by logging when the transaction is first allocated. Also
adds explicit logs about transaction state transitions.

Change-Id: I46b3a6326ec853e3d1fc32e9820f00d950fd9100
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/service/AbstractDataBroker.xtend

index 32e59b8..f90465f 100644 (file)
@@ -324,6 +324,8 @@ package class TwoPhaseCommit<P extends Path<P>, D, DCL extends DataChangeListene
 \r
 public abstract class AbstractDataTransaction<P extends Path<P>, D> extends AbstractDataModification<P, D> {\r
 \r
+    private static val LOG = LoggerFactory.getLogger(AbstractDataTransaction);
+
     @Property\r
     private val Object identifier;\r
 \r
@@ -336,6 +338,7 @@ public abstract class AbstractDataTransaction<P extends Path<P>, D> extends Abst
         _identifier = identifier;\r
         broker = dataBroker;\r
         status = TransactionStatus.NEW;\r
+        LOG.debug("Transaction {} Allocated.", identifier);
 \r
     //listeners = new ListenerRegistry<>();\r
     }\r
@@ -393,6 +396,7 @@ public abstract class AbstractDataTransaction<P extends Path<P>, D> extends Abst
     protected abstract def void onStatusChange(TransactionStatus status);\r
 \r
     public def changeStatus(TransactionStatus status) {\r
+        LOG.debug("Transaction {} transitioned from {} to {}", identifier, this.status, status);
         this.status = status;\r
         onStatusChange(status);\r
     }\r

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.