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 4fd5666ae207a77143f5fc3808c04d8e4417db34..2296eabe27a9ed818031af09360130a9815511e2 100644 (file)
@@ -188,6 +188,8 @@ public class RaftActorContextImpl implements RaftActorContext {
 
     @Override
     public void setLastApplied(long 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;
     }
 
@@ -201,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;
     }