Reduce verbosity/criticality of inconsistent yangstore messages 49/4749/6
authorRobert Varga <rovarga@cisco.com>
Fri, 24 Jan 2014 23:40:04 +0000 (00:40 +0100)
committerRobert Varga <rovarga@cisco.com>
Sun, 26 Jan 2014 03:15:25 +0000 (04:15 +0100)
Directs yangtools warnings into the logfile and updates yangstore
messages such that we know when the store reaches consistent state after
being inconsistent.

Change-Id: Ica26af53ba7e39329e32014c46564adc793bbdfb
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/config/yang-store-impl/src/main/java/org/opendaylight/controller/config/yang/store/impl/ExtenderYangTracker.java
opendaylight/distribution/opendaylight/src/main/resources/configuration/logback.xml

index 74a36c553fe7237e1a7df4bc7dff24c18bc6b28b..889d246784a05bfa1dd425ff3a6e2daaa09a7f39 100644 (file)
@@ -120,9 +120,9 @@ public class ExtenderYangTracker extends BundleTracker<Object> implements YangSt
         // inconsistent state
         inconsistentBundlesToYangURLs.putAll(bundle, addedURLs);
 
-        logger.debug("Yang store is falling back on last consistent state containing {}, inconsistent yang files {}",
+        logger.debug("Yang store is falling back to last consistent state containing {}, inconsistent yang files {}",
                 consistentBundlesToYangURLs, inconsistentBundlesToYangURLs, failureReason);
-        logger.warn("Yang store is falling back on last consistent state containing {} files, inconsistent yang files size is {}, reason {}",
+        logger.info("Yang store is falling back to last consistent state containing {} files, keeping {} inconsistent yang files due to {}",
                 consistentBundlesToYangURLs.size(), inconsistentBundlesToYangURLs.size(), failureReason.toString());
         cache.setInconsistentURLsForReporting(inconsistentBundlesToYangURLs.values());
     }
@@ -132,12 +132,17 @@ public class ExtenderYangTracker extends BundleTracker<Object> implements YangSt
         // merge into
         consistentBundlesToYangURLs.clear();
         consistentBundlesToYangURLs.putAll(proposedNewState);
-        inconsistentBundlesToYangURLs.clear();
+
+        logger.debug("Yang store updated to new consistent state containing {}", consistentBundlesToYangURLs);
+
+        // If we cleared up some inconsistent models, report that
+        if (!inconsistentBundlesToYangURLs.isEmpty()) {
+            inconsistentBundlesToYangURLs.clear();
+            logger.info("Yang store updated to new consistent state containing {} yang files", consistentBundlesToYangURLs.size());
+        }
 
         updateCache(snapshot);
         cache.setInconsistentURLsForReporting(Collections.<URL> emptySet());
-        logger.trace("Yang store updated to new consistent state containing {} yang files", consistentBundlesToYangURLs.size());
-        logger.debug("Yang store updated to new consistent state containing {}", consistentBundlesToYangURLs);
     }
 
     private synchronized void updateCache(YangStoreSnapshotImpl snapshot) {
index a24a507840d2b259638043b9f19b82d2bf8a99a2..0345f188157d8e775be0b208839b76f6ca83f1ca 100644 (file)
   <logger name="org.opendaylight.controller.usermanager" level="INFO"/>
   <!-- Web modules -->
   <logger name="org.opendaylight.controller.web" level="INFO"/>
+
+  <!--
+       Unsynchronized controller startup causes models to crop up in random
+       order, which results in temporary inability to fully resolve a model,
+       which is usually resolved. Do not flood console, but keep the messages,
+       as they may be indicating and error.
+  -->
+  <logger name="org.opendaylight.yangtools.yang.parser.util.ModuleDependencySort" level="INFO" additivity="false">
+    <appender-ref ref="opendaylight.log"/>
+  </logger>
+
   <!-- additivity=false ensures analytics data only goes to the analytics log -->
   <logger name="audit" level="INFO" additivity="false">
        <appender-ref ref="audit-file"/>