BUG-9028: log stack traces on lastApplied changes
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / RaftActorContextImpl.java
index 4644a2d..2296eab 100644 (file)
@@ -188,7 +188,8 @@ public class RaftActorContextImpl implements RaftActorContext {
 
     @Override
     public void setLastApplied(long lastApplied) {
-        log.debug("{}: Moving last applied index from {} to {}", id, this.lastApplied, lastApplied);
+        final Throwable stackTrace = log.isTraceEnabled() ? new Throwable() : null;
+        log.debug("{}: Moving last applied index from {} to {}", id, this.lastApplied, lastApplied, stackTrace);
         this.lastApplied = lastApplied;
     }
 
@@ -202,11 +203,13 @@ public class RaftActorContextImpl implements RaftActorContext {
         return replicatedLog;
     }
 
-    @Override public ActorSystem getActorSystem() {
+    @Override
+    public ActorSystem getActorSystem() {
         return context.system();
     }
 
-    @Override public Logger getLogger() {
+    @Override
+    public Logger getLogger() {
         return this.log;
     }
 

©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.