From: Robert Varga Date: Fri, 24 Jan 2014 23:40:04 +0000 (+0100) Subject: Reduce verbosity/criticality of inconsistent yangstore messages X-Git-Tag: jenkins-controller-bulk-release-prepare-only-2-10~4^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=28fc795bb908acd6134d6b19146ba819e311237e Reduce verbosity/criticality of inconsistent yangstore messages 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 --- diff --git a/opendaylight/config/yang-store-impl/src/main/java/org/opendaylight/controller/config/yang/store/impl/ExtenderYangTracker.java b/opendaylight/config/yang-store-impl/src/main/java/org/opendaylight/controller/config/yang/store/impl/ExtenderYangTracker.java index 74a36c553f..889d246784 100644 --- a/opendaylight/config/yang-store-impl/src/main/java/org/opendaylight/controller/config/yang/store/impl/ExtenderYangTracker.java +++ b/opendaylight/config/yang-store-impl/src/main/java/org/opendaylight/controller/config/yang/store/impl/ExtenderYangTracker.java @@ -120,9 +120,9 @@ public class ExtenderYangTracker extends BundleTracker 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 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. 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) { diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/logback.xml b/opendaylight/distribution/opendaylight/src/main/resources/configuration/logback.xml index a24a507840..0345f18815 100644 --- a/opendaylight/distribution/opendaylight/src/main/resources/configuration/logback.xml +++ b/opendaylight/distribution/opendaylight/src/main/resources/configuration/logback.xml @@ -75,6 +75,17 @@ + + + + + +