Lower log level

- periodic non-error log to trace
- Host event to debug

Change-Id: I1a3e746f4cafe72dbaa648ac379a0548a93445e4
diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/device/impl/GossipDeviceStore.java b/core/store/dist/src/main/java/org/onlab/onos/store/device/impl/GossipDeviceStore.java
index 4665411..34f8b4a 100644
--- a/core/store/dist/src/main/java/org/onlab/onos/store/device/impl/GossipDeviceStore.java
+++ b/core/store/dist/src/main/java/org/onlab/onos/store/device/impl/GossipDeviceStore.java
@@ -1228,7 +1228,7 @@
                         .toList();
 
                 if (nodeIds.size() == 1 && nodeIds.get(0).equals(self)) {
-                    log.debug("No other peers in the cluster.");
+                    log.trace("No other peers in the cluster.");
                     return;
                 }
 
@@ -1358,7 +1358,7 @@
 
         @Override
         public void handle(ClusterMessage message) {
-            log.debug("Received Device Anti-Entropy advertisement from peer: {}", message.sender());
+            log.trace("Received Device Anti-Entropy advertisement from peer: {}", message.sender());
             DeviceAntiEntropyAdvertisement advertisement = SERIALIZER.decode(message.payload());
             handleAdvertisement(advertisement);
         }
diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/flow/impl/DistributedFlowRuleStore.java b/core/store/dist/src/main/java/org/onlab/onos/store/flow/impl/DistributedFlowRuleStore.java
index 14dfd0d..f7718c1 100644
--- a/core/store/dist/src/main/java/org/onlab/onos/store/flow/impl/DistributedFlowRuleStore.java
+++ b/core/store/dist/src/main/java/org/onlab/onos/store/flow/impl/DistributedFlowRuleStore.java
@@ -188,7 +188,7 @@
             @Override
             public void handle(ClusterMessage message) {
                 FlowRule rule = SERIALIZER.decode(message.payload());
-                log.debug("received get flow entry request for {}", rule);
+                log.trace("received get flow entry request for {}", rule);
                 FlowEntry flowEntry = getFlowEntryInternal(rule);
                 try {
                     message.respond(SERIALIZER.encode(flowEntry));
@@ -203,7 +203,7 @@
             @Override
             public void handle(ClusterMessage message) {
                 DeviceId deviceId = SERIALIZER.decode(message.payload());
-                log.debug("Received get flow entries request for {} from {}", deviceId, message.sender());
+                log.trace("Received get flow entries request for {} from {}", deviceId, message.sender());
                 Set<FlowEntry> flowEntries = getFlowEntriesInternal(deviceId);
                 try {
                     message.respond(SERIALIZER.encode(flowEntries));
@@ -255,7 +255,7 @@
             return getFlowEntryInternal(rule);
         }
 
-        log.debug("Forwarding getFlowEntry to {}, which is the primary (master) for device {}",
+        log.trace("Forwarding getFlowEntry to {}, which is the primary (master) for device {}",
                 replicaInfo.master().orNull(), rule.deviceId());
 
         ClusterMessage message = new ClusterMessage(
@@ -301,7 +301,7 @@
             return getFlowEntriesInternal(deviceId);
         }
 
-        log.debug("Forwarding getFlowEntries to {}, which is the primary (master) for device {}",
+        log.trace("Forwarding getFlowEntries to {}, which is the primary (master) for device {}",
                 replicaInfo.master().orNull(), deviceId);
 
         ClusterMessage message = new ClusterMessage(
@@ -359,7 +359,7 @@
             return storeBatchInternal(operation);
         }
 
-        log.debug("Forwarding storeBatch to {}, which is the primary (master) for device {}",
+        log.trace("Forwarding storeBatch to {}, which is the primary (master) for device {}",
                 replicaInfo.master().orNull(), deviceId);
 
         ClusterMessage message = new ClusterMessage(
@@ -459,7 +459,7 @@
             return addOrUpdateFlowRuleInternal(rule);
         }
 
-        log.error("Tried to update FlowRule {} state,"
+        log.warn("Tried to update FlowRule {} state,"
                 + " while the Node was not the master.", rule);
         return null;
     }
@@ -504,7 +504,7 @@
             return removeFlowRuleInternal(rule);
         }
 
-        log.error("Tried to remove FlowRule {},"
+        log.warn("Tried to remove FlowRule {},"
                 + " while the Node was not the master.", rule);
         return null;
     }
@@ -542,14 +542,14 @@
 
         flowEntriesLock.writeLock().lock();
         try {
-            log.info("Loading FlowRules for {} from backups", did);
+            log.debug("Loading FlowRules for {} from backups", did);
             SMap<FlowId, ImmutableList<StoredFlowEntry>> backupFlowTable = smaps.get(did);
             for (Entry<FlowId, ImmutableList<StoredFlowEntry>> e
                     : backupFlowTable.entrySet()) {
 
                 // TODO: should we be directly updating internal structure or
                 // should we be triggering event?
-                log.debug("loading {}", e.getValue());
+                log.trace("loading {}", e.getValue());
                 for (StoredFlowEntry entry : e.getValue()) {
                     flowEntries.remove(did, entry);
                     flowEntries.put(did, entry);
@@ -570,7 +570,7 @@
         } finally {
             flowEntriesLock.writeLock().unlock();
         }
-        log.debug("removedFromPrimary {}", removed);
+        log.trace("removedFromPrimary {}", removed);
     }
 
     private static final class TimeoutFuture
@@ -594,7 +594,7 @@
         @Override
         public void handle(final ClusterMessage message) {
             FlowRuleBatchOperation operation = SERIALIZER.decode(message.payload());
-            log.info("received batch request {}", operation);
+            log.debug("received batch request {}", operation);
 
             final DeviceId deviceId = operation.getOperations().get(0).getTarget().deviceId();
             ReplicaInfo replicaInfo = replicaInfoManager.getReplicaInfoFor(deviceId);
@@ -704,7 +704,7 @@
         @Override
         public void run() {
             try {
-                log.debug("update backup {} +{} -{}", deviceId, toAdd, toRemove);
+                log.trace("update backup {} +{} -{}", deviceId, toAdd, toRemove);
                 final SMap<FlowId, ImmutableList<StoredFlowEntry>> backupFlowTable = smaps.get(deviceId);
                 // Following should be rewritten using async APIs
                 for (StoredFlowEntry entry : toAdd) {
diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/host/impl/GossipHostStore.java b/core/store/dist/src/main/java/org/onlab/onos/store/host/impl/GossipHostStore.java
index 3b233f7..fb64435 100644
--- a/core/store/dist/src/main/java/org/onlab/onos/store/host/impl/GossipHostStore.java
+++ b/core/store/dist/src/main/java/org/onlab/onos/store/host/impl/GossipHostStore.java
@@ -459,7 +459,7 @@
         @Override
         public void handle(ClusterMessage message) {
 
-            log.info("Received host update event from peer: {}", message.sender());
+            log.debug("Received host update event from peer: {}", message.sender());
             InternalHostEvent event = (InternalHostEvent) SERIALIZER.decode(message.payload());
 
             ProviderId providerId = event.providerId();
@@ -475,7 +475,7 @@
         @Override
         public void handle(ClusterMessage message) {
 
-            log.info("Received host removed event from peer: {}", message.sender());
+            log.debug("Received host removed event from peer: {}", message.sender());
             InternalHostRemovedEvent event = (InternalHostRemovedEvent) SERIALIZER.decode(message.payload());
 
             HostId hostId = event.hostId();
@@ -503,7 +503,7 @@
                         .toList();
 
                 if (nodeIds.size() == 1 && nodeIds.get(0).equals(self)) {
-                    log.debug("No other peers in the cluster.");
+                    log.trace("No other peers in the cluster.");
                     return;
                 }
 
@@ -640,7 +640,7 @@
 
         @Override
         public void handle(ClusterMessage message) {
-            log.debug("Received Host Anti-Entropy advertisement from peer: {}", message.sender());
+            log.trace("Received Host Anti-Entropy advertisement from peer: {}", message.sender());
             HostAntiEntropyAdvertisement advertisement = SERIALIZER.decode(message.payload());
             handleAntiEntropyAdvertisement(advertisement);
         }
diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/link/impl/GossipLinkStore.java b/core/store/dist/src/main/java/org/onlab/onos/store/link/impl/GossipLinkStore.java
index d4b0916..2ae6cd8 100644
--- a/core/store/dist/src/main/java/org/onlab/onos/store/link/impl/GossipLinkStore.java
+++ b/core/store/dist/src/main/java/org/onlab/onos/store/link/impl/GossipLinkStore.java
@@ -638,7 +638,7 @@
                         .toList();
 
                 if (nodeIds.size() == 1 && nodeIds.get(0).equals(self)) {
-                    log.debug("No other peers in the cluster.");
+                    log.trace("No other peers in the cluster.");
                     return;
                 }
 
@@ -796,7 +796,7 @@
 
         @Override
         public void handle(ClusterMessage message) {
-            log.debug("Received Link Anti-Entropy advertisement from peer: {}", message.sender());
+            log.trace("Received Link Anti-Entropy advertisement from peer: {}", message.sender());
             LinkAntiEntropyAdvertisement advertisement = SERIALIZER.decode(message.payload());
             handleAntiEntropyAdvertisement(advertisement);
         }
diff --git a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowStatsCollector.java b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowStatsCollector.java
index dcb953a..7627f5c 100644
--- a/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowStatsCollector.java
+++ b/providers/openflow/flow/src/main/java/org/onlab/onos/provider/of/flow/impl/FlowStatsCollector.java
@@ -49,12 +49,12 @@
 
     @Override
     public void run(Timeout timeout) throws Exception {
-        log.debug("Collecting stats for {}", this.sw.getStringId());
+        log.trace("Collecting stats for {}", this.sw.getStringId());
 
         sendFlowStatistics();
 
         if (!this.stopTimer) {
-            log.debug("Scheduling stats collection in {} seconds for {}",
+            log.trace("Scheduling stats collection in {} seconds for {}",
                     this.refreshInterval, this.sw.getStringId());
             timeout.getTimer().newTimeout(this, refreshInterval,
                     TimeUnit.SECONDS);