QoS Log clean-up 83/72383/16
authorMeenakshi <meenakshi.c@ericsson.com>
Mon, 28 May 2018 12:29:09 +0000 (17:59 +0530)
committerSam Hague <shague@redhat.com>
Sat, 23 Jun 2018 00:56:57 +0000 (00:56 +0000)
QoS log tags have been modified for better debugging.

Change-Id: I6ec119429363735ccbd8cadc4e4628b2fb983f49
Signed-off-by: Meenakshi <meenakshi.c@ericsson.com>
14 files changed:
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosAlertConfigListener.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosAlertEnableCLI.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosAlertGenerator.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosAlertManager.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosAlertPollIntervalCLI.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosAlertPortData.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosAlertThresholdCLI.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosEosHandler.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosInterfaceStateChangeListener.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosNeutronNetworkChangeListener.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosNeutronPortChangeListener.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosNeutronUtils.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosNodeListener.java
qosservice/impl/src/main/java/org/opendaylight/netvirt/qosservice/QosPolicyChangeListener.java

index efaed3fd6e51dd73f80b1984517345e2e51064e8..74bf2a302329a0de9538c4b0dcf708ee284f8a6f 100644 (file)
@@ -33,13 +33,13 @@ public class QosAlertConfigListener  extends
         super(QosalertConfig.class, QosAlertConfigListener.class);
         this.dataBroker = dataBroker;
         this.qosAlertManager = qosAlertManager;
-        LOG.debug("{} created",  getClass().getSimpleName());
+        LOG.trace("{} created",  getClass().getSimpleName());
     }
 
     @PostConstruct
     public void init() {
         registerListener(LogicalDatastoreType.CONFIGURATION, dataBroker);
-        LOG.debug("{} init and registerListener done", getClass().getSimpleName());
+        LOG.trace("{} init and registerListener done", getClass().getSimpleName());
     }
 
     @Override
index febe1e51fcb229be7b634892b765ad671d3afba6..9e012bb4466c9fcd4117bf9fa171194f987e9a77 100644 (file)
@@ -29,7 +29,7 @@ public class QosAlertEnableCLI extends OsgiCommandSupport {
 
     public void setQosAlertManager(QosAlertManager qosAlertManager) {
         this.qosAlertManager = qosAlertManager;
-        LOG.debug("Qos manager:{} set", qosAlertManager);
+        LOG.trace("Qos manager:{} set", qosAlertManager);
     }
 
     @Override
index 7173da862d5901aaef19ace357756746cfb1603d..ddd96c653e4541238fe94120bb5daa5d1025f256 100644 (file)
@@ -30,7 +30,11 @@ public class QosAlertGenerator {
         try {
             updateQoSAlertLog4jProperties(getPropertyMap(QosConstants.QOS_ALERT_PROPERTIES_PID));
         } catch (IOException e) {
-            LOG.error("Error updating log4j properties", e);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Error initialising log4j properties ", e);
+            } else {
+                LOG.warn("Qos Alert properties could not be initialised");
+            }
         }
     }
 
@@ -38,7 +42,11 @@ public class QosAlertGenerator {
         try {
             updateQoSAlertLog4jProperties(qosAlertProperties);
         } catch (IOException e) {
-            LOG.error("Error updating log4j properties", e);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Error updating log4j properties ", e);
+            } else {
+                LOG.warn("Qos Alert properties update failed");
+            }
         }
     }
 
@@ -84,7 +92,11 @@ public class QosAlertGenerator {
             log4jConfig.update(updateLog4jProperties);
             log4jConfig.update();
         } catch (IOException ioe) {
-            LOG.error("Exception in configuration {}", ioe);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Exception in configuration ", ioe);
+            } else {
+                LOG.warn("Could not update configuration in Config log");
+            }
         }
     }
 }
index e10d5769fffbc5c47cbac5fb003b038b678451c5..f2d0ed6d2aaa29224c79847a6872678a514e1c2e 100644 (file)
@@ -73,14 +73,13 @@ public final class QosAlertManager implements Runnable {
             final OpendaylightDirectStatisticsService odlDirectStatisticsService, final QosalertConfig defaultConfig,
             final QosNeutronUtils qosNeutronUtils, final QosEosHandler qosEosHandler,
             final IInterfaceManager interfaceManager) {
-        LOG.debug("{} created",  getClass().getSimpleName());
         this.txRunner = new ManagedNewTransactionRunnerImpl(dataBroker);
         this.odlDirectStatisticsService = odlDirectStatisticsService;
         this.interfaceManager = interfaceManager;
         this.defaultConfig = defaultConfig;
         this.qosNeutronUtils = qosNeutronUtils;
         this.qosEosHandler = qosEosHandler;
-        LOG.debug("QosAlert default config poll alertEnabled:{} threshold:{} pollInterval:{}",
+        LOG.trace("QosAlert default config poll alertEnabled:{} threshold:{} pollInterval:{}",
                 defaultConfig.isQosAlertEnabled(), defaultConfig.getQosDropPacketThreshold(),
                 defaultConfig.getQosAlertPollInterval());
         getDefaultConfig();
@@ -92,7 +91,7 @@ public final class QosAlertManager implements Runnable {
         qosAlertDpnPortNumberMap.clear();
         statsPollThreadStart = true;
         startStatsPollThread();
-        LOG.debug("{} init done", getClass().getSimpleName());
+        LOG.trace("{} init done", getClass().getSimpleName());
     }
 
     @PreDestroy
@@ -101,7 +100,7 @@ public final class QosAlertManager implements Runnable {
         if (thread != null) {
             thread.interrupt();
         }
-        LOG.debug("{} close done", getClass().getSimpleName());
+        LOG.trace("{} close done", getClass().getSimpleName());
     }
 
     private void setQosAlertOwner(boolean isOwner) {
@@ -118,7 +117,7 @@ public final class QosAlertManager implements Runnable {
     public void run() {
         LOG.debug("Qos alert poll thread started");
         while (statsPollThreadStart && alertEnabled) {
-            LOG.debug("Thread loop polling :{} threshold:{} pollInterval:{}",
+            LOG.trace("Thread loop polling :{} threshold:{} pollInterval:{}",
                     alertEnabled, alertThresholdSupplier.get(), pollInterval);
 
             try {
@@ -197,7 +196,7 @@ public final class QosAlertManager implements Runnable {
         InterfaceInfo interfaceInfo =
                 interfaceManager.getInterfaceInfoFromOperationalDataStore(ifaceId);
         if (interfaceInfo == null) {
-            LOG.debug("Interface not found {}. Add in cache now and process later ", ifaceId);
+            LOG.debug("Interface not found {}. Added in cache now to process later ", ifaceId);
             unprocessedInterfaceIds.add(ifaceId);
         } else {
             addToQosAlertCache(interfaceInfo);
@@ -214,13 +213,14 @@ public final class QosAlertManager implements Runnable {
     private void addToQosAlertCache(InterfaceInfo interfaceInfo) {
         BigInteger dpnId = interfaceInfo.getDpId();
         if (dpnId.equals(IfmConstants.INVALID_DPID)) {
-            LOG.error("Interface {} has INVALID_DPID", interfaceInfo.getInterfaceName());
+            LOG.warn("Interface {} could not be added to Qos Alert Cache because Dpn Id is not found",
+                    interfaceInfo.getInterfaceName());
             return;
         }
 
         Port port = qosNeutronUtils.getNeutronPort(interfaceInfo.getInterfaceName());
         if (port == null) {
-            LOG.error("Port {} not found", interfaceInfo.getInterfaceName());
+            LOG.warn("Port {} not added to Qos Alert Cache because it is not found", interfaceInfo.getInterfaceName());
             return;
         }
 
@@ -251,7 +251,7 @@ public final class QosAlertManager implements Runnable {
         BigInteger dpnId = qosNeutronUtils.getDpnIdFromLowerLayerIf(lowerLayerIf);
         String portNumber = qosNeutronUtils.getPortNumberFromLowerLayerIf(lowerLayerIf);
         if (dpnId == null || portNumber == null) {
-            LOG.error("interface {} not in openflow:dpnid:portnum format", lowerLayerIf);
+            LOG.warn("Interface {} not in openflow:dpnid:portnum format, could not remove from cache", lowerLayerIf);
             return;
         }
         removeFromQosAlertCache(dpnId, portNumber);
@@ -261,9 +261,9 @@ public final class QosAlertManager implements Runnable {
         if (qosAlertDpnPortNumberMap.containsKey(dpnId)
                 && qosAlertDpnPortNumberMap.get(dpnId).containsKey(portNumber)) {
             qosAlertDpnPortNumberMap.get(dpnId).remove(portNumber);
-            LOG.debug("Removed interace {}:{} from cache", dpnId, portNumber);
+            LOG.trace("Removed interace {}:{} from cache", dpnId, portNumber);
             if (qosAlertDpnPortNumberMap.get(dpnId).isEmpty()) {
-                LOG.debug("DPN {} empty. Removing dpn from cache as well", dpnId);
+                LOG.trace("DPN {} empty. Removing dpn from cache", dpnId);
                 qosAlertDpnPortNumberMap.remove(dpnId);
             }
         }
@@ -301,7 +301,11 @@ public final class QosAlertManager implements Runnable {
             try {
                 rpcResult = rpcResultFuture.get();
             } catch (InterruptedException | ExecutionException e) {
-                LOG.error("Exception {} occurred with node {} Direct-Statistics get", e, dpn);
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Could not get Direct-Statistics for node {} Exception occurred ", dpn, e);
+                } else {
+                    LOG.info("Could not get Direct-Statistics for node {}", dpn);
+                }
             }
             if (rpcResult != null && rpcResult.isSuccessful() && rpcResult.getResult() != null) {
 
@@ -318,7 +322,7 @@ public final class QosAlertManager implements Runnable {
                     }
                 }
             } else {
-                LOG.error("Direct-Statistics not available for node {}", dpn);
+                LOG.info("Direct-Statistics not available for node {}", dpn);
             }
 
         }
index 76d38890ab09bc72ee2e503002a31fd5f59de8ab..998b860172e6f7558f57473814b5c470ded16965 100644 (file)
@@ -27,7 +27,7 @@ public class QosAlertPollIntervalCLI extends OsgiCommandSupport {
 
     public void setQosAlertManager(QosAlertManager qosAlertManager) {
         this.qosAlertManager = qosAlertManager;
-        LOG.debug("Qos manager:{} set", qosAlertManager);
+        LOG.trace("Qos manager:{} set", qosAlertManager);
     }
 
     @Override
index d2f2763675c7129d19a1e4ee251a70c085b02cd8..5ee186d1154cb890528d8243ce7703e3b2bc629e 100644 (file)
@@ -42,7 +42,7 @@ public class QosAlertPortData {
     }
 
     public void updatePortStatistics(NodeConnectorStatisticsAndPortNumberMap statsData) {
-        LOG.trace("Port {} rx-packets {} tx-packets {} rx-dropped {} tx-dropped {}", port.getUuid(),
+        LOG.trace("Port {} rx-packets {} tx-packets {} rx-dropped {} tx-dropped {}", port.getUuid().getValue(),
                            statsData.getPackets().getReceived(), statsData.getPackets().getTransmitted(),
                            statsData.getReceiveDrops(), statsData.getTransmitDrops());
         if (statsDataInit) {
@@ -59,12 +59,12 @@ public class QosAlertPortData {
         BigInteger rxDroppedDiff = statsData.getReceiveDrops().subtract(rxDroppedPackets);
 
         if ((rxDiff.signum() < 0) || (rxDroppedDiff.signum() < 0)) {
-            LOG.debug("Port {} counters reset", port.getUuid());
+            LOG.debug("Port {} counters reset", port.getUuid().getValue());
             initPortData(); // counters wrapped. wait for one more poll.
             return;
         }
         BigInteger rxTotalDiff = rxDiff.add(rxDroppedDiff);
-        LOG.trace("Port {} rxDiff:{} rxDropped diff:{} total diff:{}", port.getUuid(), rxDiff,
+        LOG.trace("Port {} rxDiff:{} rxDropped diff:{} total diff:{}", port.getUuid().getValue(), rxDiff,
                                                                             rxDroppedDiff, rxTotalDiff);
         QosPolicy qosPolicy = qosNeutronUtils.getQosPolicy(port);
 
index 8132676fc7f58edd8f43c5145e5390a82000999e..ac59670e05156ae4cfd943f4480beeb631f7db45 100644 (file)
@@ -27,7 +27,7 @@ public class QosAlertThresholdCLI extends OsgiCommandSupport {
 
     public void setQosAlertManager(QosAlertManager qosAlertManager) {
         this.qosAlertManager = qosAlertManager;
-        LOG.debug("Qos manager:{} set", qosAlertManager);
+        LOG.trace("Qos manager:{} set", qosAlertManager);
     }
 
     @Override
index 5e6c55f767fb234712aa3f5844456e80a121e33e..b1ab1a64049f998aab43bd0df1f90d60b37fa066 100644 (file)
@@ -70,11 +70,10 @@ public class QosEosHandler implements EntityOwnershipListener, AutoCloseable {
                 QosConstants.QOS_ALERT_OWNER_ENTITY_TYPE, QosConstants.QOS_ALERT_OWNER_ENTITY_TYPE);
         try {
             candidateRegistration = entityOwnershipService.registerCandidate(instanceEntity);
+            LOG.trace("entity ownership registeration successful");
         } catch (CandidateAlreadyRegisteredException e) {
-            LOG.warn("qosalert instance entity {} was already "
-                    + "registered for ownership", instanceEntity);
+            LOG.trace("qosalert instance entity {} was already registered for ownership", instanceEntity);
         }
-        LOG.trace("entity ownership registeration successful");
     }
 
     @Override
index d9355dd43e41675f9e4eb5a95bd540eddc6d81b9..447c83630ed6013012f1a3c74577eb94cb5ba6c9 100644 (file)
@@ -58,13 +58,13 @@ public class QosInterfaceStateChangeListener extends AsyncClusteredDataTreeChang
         this.neutronVpnManager = neutronVpnManager;
         serviceRecoveryRegistry.addRecoverableListener(qosServiceRecoveryHandler.buildServiceRegistryKey(),
                 this);
-        LOG.debug("{} created",  getClass().getSimpleName());
+        LOG.trace("{} created",  getClass().getSimpleName());
     }
 
     @PostConstruct
     public void init() {
         registerListener();
-        LOG.debug("{} init and registerListener done", getClass().getSimpleName());
+        LOG.trace("{} init and registerListener done", getClass().getSimpleName());
     }
 
     @Override
@@ -85,31 +85,27 @@ public class QosInterfaceStateChangeListener extends AsyncClusteredDataTreeChang
     @Override
     @SuppressWarnings("checkstyle:IllegalCatch")
     protected void add(InstanceIdentifier<Interface> identifier, Interface intrf) {
-        try {
-            if (L2vlan.class.equals(intrf.getType())) {
-                final String interfaceName = intrf.getName();
-                getNeutronPort(interfaceName).ifPresent(port -> {
-                    Network network = qosNeutronUtils.getNeutronNetwork(port.getNetworkId());
-                    LOG.trace("Qos Service : Received interface {} PORT UP event ", interfaceName);
-                    if (port.augmentation(QosPortExtension.class) != null) {
-                        Uuid portQosUuid = port.augmentation(QosPortExtension.class).getQosPolicyId();
-                        if (portQosUuid != null) {
-                            qosNeutronUtils.addToQosPortsCache(portQosUuid, port);
-                            qosNeutronUtils.handleQosInterfaceAdd(port, portQosUuid);
-                        }
-                    } else {
-                        if (network.augmentation(QosNetworkExtension.class) != null) {
-                            Uuid networkQosUuid = network.augmentation(QosNetworkExtension.class).getQosPolicyId();
-                            if (networkQosUuid != null) {
-                                qosNeutronUtils.handleQosInterfaceAdd(port, networkQosUuid);
-                            }
+        if (L2vlan.class.equals(intrf.getType())) {
+            final String interfaceName = intrf.getName();
+            getNeutronPort(interfaceName).ifPresent(port -> {
+                Network network = qosNeutronUtils.getNeutronNetwork(port.getNetworkId());
+                LOG.debug("Qos Service : Received interface {} PORT UP event ", interfaceName);
+                if (port.augmentation(QosPortExtension.class) != null) {
+                    Uuid portQosUuid = port.augmentation(QosPortExtension.class).getQosPolicyId();
+                    if (portQosUuid != null) {
+                        qosNeutronUtils.addToQosPortsCache(portQosUuid, port);
+                        qosNeutronUtils.handleQosInterfaceAdd(port, portQosUuid);
+                    }
+                } else {
+                    if (network.augmentation(QosNetworkExtension.class) != null) {
+                        Uuid networkQosUuid = network.augmentation(QosNetworkExtension.class).getQosPolicyId();
+                        if (networkQosUuid != null) {
+                            qosNeutronUtils.handleQosInterfaceAdd(port, networkQosUuid);
                         }
                     }
-                    qosAlertManager.processInterfaceUpEvent(interfaceName);
-                });
-            }
-        } catch (Exception e) {
-            LOG.error("Qos:Exception caught in Interface Operational State Up event {}", e);
+                }
+                qosAlertManager.processInterfaceUpEvent(interfaceName);
+            });
         }
     }
 
index 097364eb0c7010f721f73ce8aa41ae05b7a02b96..d316e747cccd52cba4f947ad3a04b2672f6e445b 100644 (file)
@@ -41,13 +41,13 @@ public class QosNeutronNetworkChangeListener extends AsyncClusteredDataTreeChang
         this.qosNeutronUtils = qosNeutronUtils;
         serviceRecoveryRegistry.addRecoverableListener(qosServiceRecoveryHandler.buildServiceRegistryKey(),
                 this);
-        LOG.debug("{} created",  getClass().getSimpleName());
+        LOG.trace("{} created",  getClass().getSimpleName());
     }
 
     @PostConstruct
     public void init() {
         registerListener();
-        LOG.debug("{} init and registerListener done", getClass().getSimpleName());
+        LOG.trace("{} init and registerListener done", getClass().getSimpleName());
     }
 
     @Override
index 61ae08e4b1a3ebdac58a10807a5635b5fcc4a492..13b8c01708e0a4889d6f95eb1bc5164a7b88de8a 100644 (file)
@@ -52,13 +52,13 @@ public class QosNeutronPortChangeListener extends AsyncClusteredDataTreeChangeLi
         this.jobCoordinator = jobCoordinator;
         serviceRecoveryRegistry.addRecoverableListener(qosServiceRecoveryHandler.buildServiceRegistryKey(),
                 this);
-        LOG.debug("{} created",  getClass().getSimpleName());
+        LOG.trace("{} created",  getClass().getSimpleName());
     }
 
     @PostConstruct
     public void init() {
         registerListener();
-        LOG.debug("{} init and registerListener done", getClass().getSimpleName());
+        LOG.trace("{} init and registerListener done", getClass().getSimpleName());
     }
 
     @Override
index 086167b8849ad55afc3a31972b03af2b9b67daaa..fcbf73f60870d0b2d846d17b8e56121aa9f7d850 100644 (file)
@@ -197,7 +197,8 @@ public class QosNeutronUtils {
     }
 
     public void handleNeutronPortQosAdd(Port port, Uuid qosUuid) {
-        LOG.trace("Handling Port add and QoS associated: port: {} qos: {}", port.getUuid(), qosUuid);
+        LOG.debug("Handling Port add and QoS associated: port: {} qos: {}", port.getUuid().getValue(),
+                qosUuid.getValue());
 
         QosPolicy qosPolicy = qosPolicyMap.get(qosUuid);
 
@@ -217,7 +218,8 @@ public class QosNeutronUtils {
     }
 
     public void handleQosInterfaceAdd(Port port, Uuid qosUuid) {
-        LOG.trace("Handling Port add and QoS associated: port: {} qos: {}", port.getUuid(), qosUuid);
+        LOG.debug("Handling Port add and QoS associated: port: {} qos: {}", port.getUuid().getValue(),
+                qosUuid.getValue());
 
         QosPolicy qosPolicy = qosPolicyMap.get(qosUuid);
 
@@ -232,7 +234,8 @@ public class QosNeutronUtils {
     }
 
     public void handleNeutronPortQosUpdate(Port port, Uuid qosUuidNew, Uuid qosUuidOld) {
-        LOG.trace("Handling Port QoS update: port: {} qosservice: {}", port.getUuid(), qosUuidNew);
+        LOG.debug("Handling Port QoS update: port: {} qosservice: {}", port.getUuid().getValue(),
+                qosUuidNew.getValue());
 
         QosPolicy qosPolicyNew = qosPolicyMap.get(qosUuidNew);
         QosPolicy qosPolicyOld = qosPolicyMap.get(qosUuidOld);
@@ -266,7 +269,7 @@ public class QosNeutronUtils {
     }
 
     public void handleNeutronPortQosRemove(Port port, Uuid qosUuid) {
-        LOG.trace("Handling Port QoS removal: port: {} qosservice: {}", port.getUuid(), qosUuid);
+        LOG.debug("Handling Port QoS removal: port: {} qosservice: {}", port.getUuid().getValue(), qosUuid.getValue());
 
         // check for network qosservice to apply
         Network network =  neutronVpnManager.getNeutronNetwork(port.getNetworkId());
@@ -298,7 +301,8 @@ public class QosNeutronUtils {
     }
 
     public void handleNeutronPortRemove(Port port, Uuid qosUuid) {
-        LOG.trace("Handling Port removal and Qos associated: port: {} qos: {}", port.getUuid(), qosUuid);
+        LOG.debug("Handling Port removal and Qos associated: port: {} qos: {}", port.getUuid().getValue(),
+                qosUuid.getValue());
         QosPolicy qosPolicy = qosPolicyMap.get(qosUuid);
 
         jobCoordinator.enqueueJob("QosPort-" + port.getUuid().getValue(), () -> {
@@ -312,7 +316,8 @@ public class QosNeutronUtils {
     }
 
     public void handleNeutronPortRemove(Port port, Uuid qosUuid, Interface intrf) {
-        LOG.trace("Handling Port removal and Qos associated: port: {} qos: {}", port.getUuid(), qosUuid);
+        LOG.debug("Handling Port removal and Qos associated: port: {} qos: {}", port.getUuid().getValue(),
+                qosUuid.getValue());
         QosPolicy qosPolicy = qosPolicyMap.get(qosUuid);
 
         jobCoordinator.enqueueJob("QosPort-" + port.getUuid().getValue(), () -> {
@@ -326,7 +331,7 @@ public class QosNeutronUtils {
 
 
     public void handleNeutronNetworkQosUpdate(Network network, Uuid qosUuid) {
-        LOG.trace("Handling Network QoS update: net: {} qosservice: {}", network.getUuid(), qosUuid);
+        LOG.debug("Handling Network QoS update: net: {} qosservice: {}", network.getUuid().getValue(), qosUuid);
         QosPolicy qosPolicy = qosPolicyMap.get(qosUuid);
         if (qosPolicy == null || (qosPolicy.getBandwidthLimitRules() == null
                 || qosPolicy.getBandwidthLimitRules().isEmpty())
@@ -358,7 +363,8 @@ public class QosNeutronUtils {
     }
 
     public void handleNeutronNetworkQosRemove(Network network, Uuid qosUuid) {
-        LOG.trace("Handling Network QoS removal: net: {} qosservice: {}", network.getUuid(), qosUuid);
+        LOG.debug("Handling Network QoS removal: net: {} qosservice: {}", network.getUuid().getValue(),
+                qosUuid.getValue());
         QosPolicy qosPolicy = qosPolicyMap.get(qosUuid);
 
         List<Uuid> subnetIds = getSubnetIdsFromNetworkId(network.getUuid());
@@ -388,7 +394,7 @@ public class QosNeutronUtils {
     }
 
     public void handleNeutronNetworkQosBwRuleRemove(Network network, BandwidthLimitRules zeroBwLimitRule) {
-        LOG.trace("Handling Qos Bandwidth Rule Remove, net: {}", network.getUuid());
+        LOG.debug("Handling Qos Bandwidth Rule Remove, net: {}", network.getUuid().getValue());
 
         List<Uuid> subnetIds = getSubnetIdsFromNetworkId(network.getUuid());
 
@@ -407,7 +413,7 @@ public class QosNeutronUtils {
     }
 
     public void handleNeutronNetworkQosDscpRuleRemove(Network network) {
-        LOG.trace("Handling Qos Dscp Rule Remove, net: {}", network.getUuid());
+        LOG.debug("Handling Qos Dscp Rule Remove, net: {}", network.getUuid().getValue());
 
         List<Uuid> subnetIds = getSubnetIdsFromNetworkId(network.getUuid());
 
@@ -430,17 +436,16 @@ public class QosNeutronUtils {
     @SuppressWarnings("checkstyle:IllegalCatch")
     public void setPortBandwidthLimits(Port port, BandwidthLimitRules bwLimit, WriteTransaction writeConfigTxn) {
         if (!qosEosHandler.isQosClusterOwner()) {
-            LOG.trace("Not Qos Cluster Owner. Ignoring setting bandwidth limits");
+            LOG.debug("Not Qos Cluster Owner. Ignoring setting bandwidth limits");
             return;
         }
-        LOG.trace("Setting bandwidth limits {} on Port {}", port, bwLimit);
-
         BigInteger dpId = getDpnForInterface(port.getUuid().getValue());
         if (dpId.equals(BigInteger.ZERO)) {
             LOG.info("DPN ID for interface {} not found", port.getUuid().getValue());
             return;
         }
 
+        LOG.trace("Setting bandwidth limits {} on Port {}", port.getUuid().getValue(), bwLimit);
         OvsdbBridgeRef bridgeRefEntry = getBridgeRefEntryFromOperDS(dpId);
         Optional<Node> bridgeNode = MDSALUtil.read(LogicalDatastoreType.OPERATIONAL,
                 bridgeRefEntry.getValue().firstIdentifierOf(Node.class), dataBroker);
@@ -473,7 +478,12 @@ public class QosNeutronUtils {
                         .child(TerminationPoint.class, new TerminationPointKey(tp.key())), tpBuilder.build());
             }
         } catch (Exception e) {
-            LOG.error("Failure while setting BwLimitRule {} to port {}", bwLimit, port, e);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Failure while setting BwLimitRule {} to port {} exception ", bwLimit,
+                        port.getUuid().getValue(), e);
+            } else {
+                LOG.error("Failure while setting BwLimitRule {} to port {}", bwLimit, port.getUuid().getValue());
+            }
         }
 
     }
@@ -483,7 +493,6 @@ public class QosNeutronUtils {
             LOG.trace("Not Qos Cluster Owner. Ignoring setting DSCP marking");
             return;
         }
-        LOG.trace("Setting DSCP value {} on Port {}", port, dscpMark);
 
         BigInteger dpnId = getDpnForInterface(port.getUuid().getValue());
         String ifName = port.getUuid().getValue();
@@ -491,12 +500,11 @@ public class QosNeutronUtils {
         Short dscpValue = dscpMark.getDscpMark();
 
         if (dpnId.equals(BigInteger.ZERO)) {
-            LOG.info("DPN ID for interface {} not found", port.getUuid().getValue());
+            LOG.info("DPN ID for interface {} not found. Cannot set dscp value {} on port {}",
+                    port.getUuid().getValue(), dscpMark, port.getUuid().getValue());
             return;
         }
-
         int ipVersions = getIpVersions(port);
-
         //1. OF rules
         if (hasIpv4Addr(ipVersions)) {
             LOG.trace("setting ipv4 flow for port: {}, dscp: {}", ifName, dscpValue);
@@ -515,20 +523,19 @@ public class QosNeutronUtils {
 
     public void unsetPortDscpMark(Port port) {
         if (!qosEosHandler.isQosClusterOwner()) {
-            LOG.trace("Not Qos Cluster Owner. Ignoring unsetting DSCP marking");
+            LOG.debug("Not Qos Cluster Owner. Ignoring unsetting DSCP marking");
             return;
         }
-        LOG.trace("Removing dscp marking rule from Port {}", port);
 
         BigInteger dpnId = getDpnForInterface(port.getUuid().getValue());
         String ifName = port.getUuid().getValue();
 
         if (dpnId.equals(BigInteger.ZERO)) {
-            LOG.info("DPN ID for port {} not found", port);
+            LOG.debug("DPN ID for port {} not found. Cannot unset dscp value", port.getUuid().getValue());
             return;
         }
+        LOG.trace("Removing dscp marking rule from Port {}", port.getUuid().getValue());
         Interface intf = getInterfaceStateFromOperDS(ifName);
-
         //unbind service from interface
         unbindservice(ifName);
         // 1. OF
@@ -546,15 +553,14 @@ public class QosNeutronUtils {
         if (!qosEosHandler.isQosClusterOwner()) {
             return;
         }
-        LOG.trace("Removing dscp marking rule from Port {}", port);
-
         BigInteger dpnId = getDpIdFromInterface(intrf);
         String ifName = port.getUuid().getValue();
 
         if (dpnId.equals(BigInteger.ZERO)) {
-            LOG.error("Unable to retrieve DPN Id for interface {}", ifName);
+            LOG.error("Unable to retrieve DPN Id for interface {}. Cannot unset dscp value on port", ifName);
             return;
         }
+        LOG.trace("Removing dscp marking rule from Port {}", port.getUuid().getValue());
         unbindservice(ifName);
         int ipVersions = getIpVersions(port);
         if (hasIpv4Addr(ipVersions)) {
@@ -587,7 +593,11 @@ public class QosNeutronUtils {
                 LOG.error("Could not retrieve DPN Id for interface {}", ifName);
             }
         } catch (NullPointerException | InterruptedException | ExecutionException e) {
-            LOG.error("Exception when getting dpn for interface {}", ifName,  e);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Exception when getting DPN for interface {} exception ", ifName, e);
+            } else {
+                LOG.error("Could not retrieve DPN for interface {}", ifName);
+            }
         }
         return nodeId;
     }
@@ -653,7 +663,7 @@ public class QosNeutronUtils {
 
     public void addFlow(BigInteger dpnId, Short dscpValue, String ifName, int ethType, Interface ifState) {
         if (ifState == null) {
-            LOG.trace("Could not find the ifState for interface {}", ifName);
+            LOG.debug("Could not find the ifState for interface {}", ifName);
             return;
         }
         Integer ifIndex = ifState.getIfIndex();
@@ -676,7 +686,7 @@ public class QosNeutronUtils {
 
     public void removeFlow(BigInteger dpnId, String ifName, int ethType, Interface ifState) {
         if (ifState == null) {
-            LOG.trace("Could not find the ifState for interface {}", ifName);
+            LOG.debug("Could not find the ifState for interface {}", ifName);
             return;
         }
         Integer ifIndex = ifState.getIfIndex();
@@ -750,12 +760,12 @@ public class QosNeutronUtils {
     }
 
     public boolean portHasQosPolicy(Port port) {
-        LOG.trace("checking qos policy for port: {}", port.getUuid());
+        LOG.trace("checking qos policy for port: {}", port.getUuid().getValue());
 
         boolean isQosPolicy = port.augmentation(QosPortExtension.class) != null
                 && port.augmentation(QosPortExtension.class).getQosPolicyId() != null;
 
-        LOG.trace("portHasQosPolicy for  port: {} return value {}", port.getUuid(), isQosPolicy);
+        LOG.trace("portHasQosPolicy for  port: {} return value {}", port.getUuid().getValue(), isQosPolicy);
         return isQosPolicy;
     }
 
index 4bc2dee725da387aafc5e0dd543a76ca8ae8c975..1c338135794f1786aed9c917f8b9f3be45dcb5ae 100644 (file)
@@ -53,14 +53,14 @@ public class QosNodeListener extends AsyncDataTreeChangeListenerBase<FlowCapable
         this.mdsalUtils = mdsalUtils;
         serviceRecoveryRegistry.addRecoverableListener(qosServiceRecoveryHandler.buildServiceRegistryKey(),
                 this);
-        LOG.debug("{} created",  getClass().getSimpleName());
+        LOG.trace("{} created",  getClass().getSimpleName());
     }
 
     @Override
     @PostConstruct
     public void init() {
         registerListener();
-        LOG.debug("{} init and registerListener done", getClass().getSimpleName());
+        LOG.trace("{} init and registerListener done", getClass().getSimpleName());
     }
 
     @Override
index 1eccb9bc8f09ed827770fcaa4418c13bf4ea61cf..efc76a656041cfa0febe8bbf75da3309a4c5cd12 100644 (file)
@@ -67,14 +67,14 @@ public class QosPolicyChangeListener extends AsyncClusteredDataTreeChangeListene
         this.jobCoordinator = jobCoordinator;
         serviceRecoveryRegistry.addRecoverableListener(qosServiceRecoveryHandler.buildServiceRegistryKey(),
                 this);
-        LOG.debug("{} created",  getClass().getSimpleName());
+        LOG.trace("{} created",  getClass().getSimpleName());
     }
 
     @PostConstruct
     public void init() {
         registerListener();
         supportedQoSRuleTypes();
-        LOG.debug("{} init and registerListener done", getClass().getSimpleName());
+        LOG.trace("{} init and registerListener done", getClass().getSimpleName());
     }
 
     @Override
@@ -157,12 +157,14 @@ public class QosPolicyChangeListener extends AsyncClusteredDataTreeChangeListene
 
     @Override
     protected void add(InstanceIdentifier<QosPolicy> identifier, QosPolicy input) {
-        LOG.trace("Adding  QosPolicy : key: {}, value={}", identifier, input);
+        LOG.debug("Adding  QosPolicy : key: {}, value={}",
+                identifier.firstKeyOf(QosPolicy.class).getUuid().getValue(),input);
         qosNeutronUtils.addToQosPolicyCache(input);
     }
 
     protected void add(InstanceIdentifier<BandwidthLimitRules> identifier, BandwidthLimitRules input) {
-        LOG.trace("Adding BandwidthlimitRules : key: {}, value={}", identifier, input);
+        LOG.debug("Adding BandwidthlimitRules : key: {}, value={}",
+                identifier.firstKeyOf(QosPolicy.class).getUuid().getValue(), input);
 
         Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
         for (Network network : qosNeutronUtils.getQosNetworks(qosUuid)) {
@@ -177,7 +179,8 @@ public class QosPolicyChangeListener extends AsyncClusteredDataTreeChangeListene
     }
 
     private void add(InstanceIdentifier<DscpmarkingRules> identifier, DscpmarkingRules input) {
-        LOG.trace("Adding DscpMarkingRules : key: {}, value={}", identifier, input);
+        LOG.debug("Adding DscpMarkingRules : key: {}, value={}",
+                identifier.firstKeyOf(QosPolicy.class).getUuid().getValue(), input);
 
         Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
 
@@ -195,12 +198,14 @@ public class QosPolicyChangeListener extends AsyncClusteredDataTreeChangeListene
 
     @Override
     protected void remove(InstanceIdentifier<QosPolicy> identifier, QosPolicy input) {
-        LOG.trace("Removing QosPolicy : key: {}, value={}", identifier, input);
+        LOG.debug("Removing QosPolicy : key: {}, value={}",
+                identifier.firstKeyOf(QosPolicy.class).getUuid().getValue(), input);
         qosNeutronUtils.removeFromQosPolicyCache(input);
     }
 
     private void remove(InstanceIdentifier<BandwidthLimitRules> identifier, BandwidthLimitRules input) {
-        LOG.trace("Removing BandwidthLimitRules : key: {}, value={}", identifier, input);
+        LOG.debug("Removing BandwidthLimitRules : key: {}, value={}",
+                identifier.firstKeyOf(QosPolicy.class).getUuid().getValue(), input);
 
         Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
         BandwidthLimitRulesBuilder bwLimitBuilder = new BandwidthLimitRulesBuilder();
@@ -219,7 +224,8 @@ public class QosPolicyChangeListener extends AsyncClusteredDataTreeChangeListene
     }
 
     private void remove(InstanceIdentifier<DscpmarkingRules> identifier,DscpmarkingRules input) {
-        LOG.trace("Removing DscpMarkingRules : key: {}, value={}", identifier, input);
+        LOG.debug("Removing DscpMarkingRules : key: {}, value={}",
+                identifier.firstKeyOf(QosPolicy.class).getUuid().getValue(), input);
 
         Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
 
@@ -257,13 +263,15 @@ public class QosPolicyChangeListener extends AsyncClusteredDataTreeChangeListene
 
     @Override
     protected void update(InstanceIdentifier<QosPolicy> identifier, QosPolicy original, QosPolicy update) {
-        LOG.trace("Updating QosPolicy : key: {}, original value={}, update value={}", identifier, original, update);
+        LOG.debug("Updating QosPolicy : key: {}, original value={}, update value={}",
+                identifier.firstKeyOf(QosPolicy.class).getUuid().getValue(), original, update);
         qosNeutronUtils.addToQosPolicyCache(update);
     }
 
     private void update(InstanceIdentifier<BandwidthLimitRules> identifier, BandwidthLimitRules original,
                         BandwidthLimitRules update) {
-        LOG.trace("Updating BandwidthLimitRules : key: {}, original value={}, update value={}", identifier, original,
+        LOG.debug("Updating BandwidthLimitRules : key: {}, original value={}, update value={}",
+                identifier.firstKeyOf(QosPolicy.class).getUuid().getValue(), original,
                 update);
         Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
         update(qosUuid, update);
@@ -283,8 +291,8 @@ public class QosPolicyChangeListener extends AsyncClusteredDataTreeChangeListene
 
     private void update(InstanceIdentifier<DscpmarkingRules> identifier, DscpmarkingRules original,
                         DscpmarkingRules update) {
-        LOG.trace("Updating DscpMarkingRules : key: {}, original value={}, update value={}", identifier, original,
-                update);
+        LOG.debug("Updating DscpMarkingRules : key: {}, original value={}, update value={}",
+                identifier.firstKeyOf(QosPolicy.class).getUuid().getValue(), original, update);
         Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
         update(qosUuid, update);
     }