From: Tom Pantelis Date: Thu, 11 May 2017 16:31:27 +0000 (-0400) Subject: Bug 8424: Don't output data tree and tree candidates wih debug X-Git-Tag: release/carbon~21 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=refs%2Fchanges%2F06%2F56906%2F1 Bug 8424: Don't output data tree and tree candidates wih debug Data trees and tree candidates can get quite large and fill up the log files when debug is on and, worst case, cause OOM errors. For debug logging, only print the whole tree/candidate with trace logging. In cases where an Optional data tree is outputted via toString, only output if the data tree is present or not. Change-Id: I6cb5f9a5da9e3cc3218c83bb103b673db0fb1d80 Signed-off-by: Tom Pantelis (cherry picked from commit 5083d20c7f49788e64ca9080aebcded623d7aa44) --- diff --git a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientSuccess.java b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientSuccess.java index c813605bf3..90eff1b227 100644 --- a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientSuccess.java +++ b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/ConnectClientSuccess.java @@ -94,7 +94,7 @@ public final class ConnectClientSuccess extends RequestSuccess messages = registry.createCanCommitMessages(txId, tip, schema); LOG.debug("{}: canCommit - messages: {}", txId, messages); diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DefaultShardDataTreeChangeListenerPublisher.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DefaultShardDataTreeChangeListenerPublisher.java index 895ce30e8b..449b620170 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DefaultShardDataTreeChangeListenerPublisher.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DefaultShardDataTreeChangeListenerPublisher.java @@ -38,7 +38,12 @@ final class DefaultShardDataTreeChangeListenerPublisher extends AbstractDOMStore @Override public void publishChanges(final DataTreeCandidate candidate) { - LOG.debug("{}: publishChanges: {}", logContext, candidate); + if (LOG.isTraceEnabled()) { + LOG.trace("{}: publishChanges: {}", logContext, candidate); + } else { + LOG.debug("{}: publishChanges: rootPath: {}", logContext, candidate.getRootPath()); + } + processCandidateTree(candidate); }