diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobCommitMessage.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobCommitMessage.java
index 55ae225..fac023c 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobCommitMessage.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobCommitMessage.java
@@ -28,15 +28,12 @@
 import org.apache.asterix.messaging.NCMessageBroker;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.job.JobId;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
 
 /**
  * Message sent from CC to all NCs asking to commit an atomic statement/job.
  */
 public class AtomicJobCommitMessage implements INcAddressedMessage {
 
-    private static final Logger LOGGER = LogManager.getLogger();
     private static final long serialVersionUID = 1L;
     private final JobId jobId;
     private final List<Integer> datasetIds;
@@ -65,4 +62,9 @@
             throw HyracksDataException.create(e);
         }
     }
+
+    @Override
+    public String toString() {
+        return "AtomicJobCommitMessage{" + "jobId=" + jobId + ", datasetIds=" + datasetIds + '}';
+    }
 }
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobCompletionMessage.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobCompletionMessage.java
index 869e5d2..a2a1e51 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobCompletionMessage.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobCompletionMessage.java
@@ -22,15 +22,12 @@
 import org.apache.asterix.common.messaging.api.ICcAddressedMessage;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.job.JobId;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
 
 /**
  * Message sent from NC to CC on successful local commit of an atomic statement/job.
  */
 public class AtomicJobCompletionMessage implements ICcAddressedMessage {
 
-    private static final Logger LOGGER = LogManager.getLogger();
     private static final long serialVersionUID = 1L;
     private final String nodeId;
     private final JobId jobId;
@@ -44,4 +41,9 @@
     public void handle(ICcApplicationContext appCtx) throws HyracksDataException, InterruptedException {
         appCtx.getGlobalTxManager().handleJobCompletionMessage(jobId, nodeId);
     }
+
+    @Override
+    public String toString() {
+        return "AtomicJobCompletionMessage{" + "jobId=" + jobId + ", nodeId='" + nodeId + '\'' + '}';
+    }
 }
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobRollbackCompleteMessage.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobRollbackCompleteMessage.java
index 90e1fbd..85f9cf4 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobRollbackCompleteMessage.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobRollbackCompleteMessage.java
@@ -22,15 +22,12 @@
 import org.apache.asterix.common.messaging.api.ICcAddressedMessage;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.job.JobId;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
 
 /**
  * Message sent from an NC to CC after successful local rollback of an atomic statement/job.
  */
 public class AtomicJobRollbackCompleteMessage implements ICcAddressedMessage {
 
-    private static final Logger LOGGER = LogManager.getLogger();
     private static final long serialVersionUID = 1L;
     private final String nodeId;
     private final JobId jobId;
@@ -45,4 +42,8 @@
         appCtx.getGlobalTxManager().handleJobRollbackCompletionMessage(jobId, nodeId);
     }
 
+    @Override
+    public String toString() {
+        return "AtomicJobRollbackCompleteMessage{" + "jobId=" + jobId + ", nodeId='" + nodeId + '\'' + '}';
+    }
 }
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobRollbackMessage.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobRollbackMessage.java
index aeb6be2..71a641e 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobRollbackMessage.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/AtomicJobRollbackMessage.java
@@ -32,15 +32,12 @@
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.job.JobId;
 import org.apache.hyracks.storage.am.lsm.common.api.ILSMComponentId;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
 
 /**
  * Message sent from CC to all NCs to rollback an atomic statement/job.
  */
 public class AtomicJobRollbackMessage implements INcAddressedMessage {
 
-    private static final Logger LOGGER = LogManager.getLogger();
     private static final long serialVersionUID = 1L;
     private final JobId jobId;
     private final List<Integer> datasetIds;
@@ -80,4 +77,9 @@
             throw new RuntimeException(e);
         }
     }
+
+    @Override
+    public String toString() {
+        return "AtomicJobRollbackMessage{" + "jobId=" + jobId + ", datasetIds=" + datasetIds + '}';
+    }
 }
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/EnableMergeMessage.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/EnableMergeMessage.java
index 900da82..050ca38 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/EnableMergeMessage.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/message/EnableMergeMessage.java
@@ -24,12 +24,9 @@
 import org.apache.asterix.common.messaging.api.INcAddressedMessage;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.job.JobId;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
 
 public class EnableMergeMessage implements INcAddressedMessage {
 
-    private static final Logger LOGGER = LogManager.getLogger();
     private static final long serialVersionUID = 1L;
     private final JobId jobId;
     private final int datasetId;
@@ -48,4 +45,9 @@
             }
         }
     }
+
+    @Override
+    public String toString() {
+        return "EnableMergeMessage{" + "jobId=" + jobId + ", datasetId=" + datasetId + '}';
+    }
 }
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/PrimaryIndexOperationTracker.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/PrimaryIndexOperationTracker.java
index 2e32fb3..7e38b8b 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/PrimaryIndexOperationTracker.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/PrimaryIndexOperationTracker.java
@@ -148,7 +148,7 @@
                 for (ILSMIndex lsmIndex : indexes) {
                     if (lsmIndex.isPrimaryIndex()) {
                         if (lsmIndex.isCurrentMutableComponentEmpty()) {
-                            LOGGER.debug("Primary index on dataset {} and partition {} is empty... skipping flush",
+                            LOGGER.trace("Primary index on dataset {} and partition {} is empty... skipping flush",
                                     dsInfo.getDatasetID(), partition);
                             return;
                         }
@@ -228,17 +228,18 @@
             }
             idGenerator.refresh();
             long flushLsn = logRecord.getLSN();
-            if (flushLsn == 0) {
-                LOGGER.warn("flushing an index with LSN 0. Flush log record: {}", logRecord::getLogRecordForDisplay);
-            }
             ILSMComponentId nextComponentId = idGenerator.getId();
             Map<String, Object> flushMap = new HashMap<>();
             flushMap.put(LSMIOOperationCallback.KEY_FLUSH_LOG_LSN, flushLsn);
             flushMap.put(LSMIOOperationCallback.KEY_NEXT_COMPONENT_ID, nextComponentId);
             for (ILSMIndex lsmIndex : dsInfo.getDatasetPartitionOpenIndexes(partition)) {
                 if (lsmIndex.isPrimaryIndex()) {
+                    if (!lsmIndex.isAtomic() && flushLsn == 0) {
+                        LOGGER.warn("flushing an index {} with LSN 0. Flush log record: {}", () -> lsmIndex,
+                                logRecord::getLogRecordForDisplay);
+                    }
                     if (lsmIndex.isCurrentMutableComponentEmpty()) {
-                        LOGGER.debug("Primary index on dataset {} and partition {} is empty... skipping flush",
+                        LOGGER.trace("Primary index on dataset {} and partition {} is empty... skipping flush",
                                 dsInfo.getDatasetID(), partition);
                         return;
                     }
@@ -379,7 +380,7 @@
         for (ILSMIndex lsmIndex : indexes) {
             if (lsmIndex.isPrimaryIndex()) {
                 if (lsmIndex.isCurrentMutableComponentEmpty()) {
-                    LOGGER.info("Primary index on dataset {} and partition {} is empty... skipping delete",
+                    LOGGER.trace("Primary index on dataset {} and partition {} is empty... skipping delete",
                             dsInfo.getDatasetID(), partition);
                     return;
                 }
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/messaging/AtomicJobPreparedMessage.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/messaging/AtomicJobPreparedMessage.java
index b4832ff..d00b531 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/messaging/AtomicJobPreparedMessage.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/messaging/AtomicJobPreparedMessage.java
@@ -25,8 +25,6 @@
 import org.apache.hyracks.api.exceptions.HyracksDataException;
 import org.apache.hyracks.api.job.JobId;
 import org.apache.hyracks.storage.am.lsm.common.api.ILSMComponentId;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
 
 /**
  * Message sent from an NC to CC for every partition handled by it after all
@@ -34,7 +32,6 @@
  */
 public class AtomicJobPreparedMessage implements ICcAddressedMessage {
 
-    private static final Logger LOGGER = LogManager.getLogger();
     private static final long serialVersionUID = 1L;
     private final JobId jobId;
     private final String nodeId;
@@ -51,4 +48,8 @@
         appCtx.getGlobalTxManager().handleJobPreparedMessage(jobId, nodeId, componentIdMap);
     }
 
+    @Override
+    public String toString() {
+        return "AtomicJobPreparedMessage{" + "jobId=" + jobId + ", nodeId='" + nodeId + '\'' + '}';
+    }
 }
