Fix logging issues in aclservice 49/69149/2
authorStephen Kitt <skitt@redhat.com>
Tue, 6 Mar 2018 17:14:45 +0000 (18:14 +0100)
committerSam Hague <shague@redhat.com>
Fri, 9 Mar 2018 01:29:26 +0000 (01:29 +0000)
Change-Id: Id3bfc4dcb205cce9d31b47da961e24f507b33d91
Signed-off-by: Stephen Kitt <skitt@redhat.com>
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/AbstractAclServiceImpl.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/EgressAclServiceImpl.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/IngressAclServiceImpl.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/utils/AclClusterUtilImpl.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/utils/AclServiceUtils.java
aclservice/shell/src/main/java/org/opendaylight/netvirt/aclservice/shell/DisplayAclDataCaches.java

index 13ee33e0197d6f7bfdcb7b61c24c10267969f593..a717de6d6d67269f83e5542e6f9d89cd14527144 100644 (file)
@@ -403,7 +403,7 @@ public abstract class AbstractAclServiceImpl implements AclServiceListener {
         }
         Integer remoteAclTag = this.aclServiceUtils.getAclTag(remoteAclId);
         if (remoteAclTag == null || remoteAclTag == AclConstants.INVALID_ACL_TAG) {
-            LOG.error("remoteAclTag=[] is null or invalid for remoteAclId={}", remoteAclTag, remoteAclId);
+            LOG.error("remoteAclTag={} is null or invalid for remoteAclId={}", remoteAclTag, remoteAclId);
             return;
         }
         List<MatchInfoBase> lportAndAclMatches =
index 5444fead7bf251173072b0ecb587fa90cbb62513..1efa1021812cb50df776ff51a3fdab60f8cbbb89 100644 (file)
@@ -316,8 +316,8 @@ public class EgressAclServiceImpl extends AbstractAclServiceImpl {
             matches.add(AclServiceUtils.buildLPortTagMatch(lportTag, serviceMode));
 
             List<InstructionInfo> instructions = getDispatcherTableResubmitInstructions();
-            LOG.debug(addOrRemove == NwConstants.DEL_FLOW ? "Deleting " : "Adding " + "ARP Rule on DPID {}, "
-                    + "lportTag {}", dpId, lportTag);
+            LOG.debug("{} ARP Rule on DPID {}, lportTag {}",
+                    addOrRemove == NwConstants.DEL_FLOW ? "Deleting" : "Adding", dpId, lportTag);
             String flowName = "Egress_ARP_" + dpId + "_" + lportTag + "_" + allowedAddress.getMacAddress().getValue()
                     + String.valueOf(allowedAddressIp.getValue());
             syncFlow(dpId, getAclAntiSpoofingTable(), flowName, AclConstants.PROTO_ARP_TRAFFIC_MATCH_PRIORITY, "ACL", 0,
index 6bacbc81d965911d0572fb7a09d75e59a2c6bb39..1137c31189e98a0ac6f43873c10949755d1365d2 100644 (file)
@@ -254,8 +254,8 @@ public class IngressAclServiceImpl extends AbstractAclServiceImpl {
         matches.add(MatchEthernetType.ARP);
         matches.add(AclServiceUtils.buildLPortTagMatch(lportTag, serviceMode));
         List<InstructionInfo> instructions = getDispatcherTableResubmitInstructions();
-        LOG.debug(addOrRemove == NwConstants.DEL_FLOW ? "Deleting " : "Adding " + "ARP Rule on DPID {}, "
-                + "lportTag {}", dpId, lportTag);
+        LOG.debug("{} ARP Rule on DPID {}, lportTag {}", addOrRemove == NwConstants.DEL_FLOW ? "Deleting" : "Adding",
+                dpId, lportTag);
         String flowName = "Ingress_ARP_" + dpId + "_" + lportTag;
         syncFlow(dpId, getAclAntiSpoofingTable(), flowName, AclConstants.PROTO_ARP_TRAFFIC_MATCH_PRIORITY, "ACL", 0, 0,
                 AclConstants.COOKIE_ACL_BASE, matches, instructions, addOrRemove);
index 3367754733218c751cc69c7c8a7dd12c207afee2..bf7bd7ee1c640c311be82b338dbf688133dbeb1c 100644 (file)
@@ -22,7 +22,7 @@ import org.slf4j.LoggerFactory;
 @Singleton
 public class AclClusterUtilImpl implements AclClusterUtil {
 
-    private static final Logger LOG = LoggerFactory.getLogger(AclClusterUtil.class);
+    private static final Logger LOG = LoggerFactory.getLogger(AclClusterUtilImpl.class);
 
     private static final String ACL_ENTITY_TYPE_FOR_OWNERSHIP = "netvirt-acl";
     private static final String ACL_ENTITY_NAME = "netvirt-acl";
index 00fe3e6354921b8b4bf2b462b22a850c42c8d029..a477cd0604cbd94ff3b5b0608c5687e3ba0205ad 100644 (file)
@@ -306,7 +306,7 @@ public final class AclServiceUtils {
         }
         InterfaceAcl aclInPort = port.getAugmentation(InterfaceAcl.class);
         if (aclInPort == null) {
-            LOG.error("getSecurityGroupInPortList: no security group associated}",
+            LOG.error("getSecurityGroupInPortList: no security group associated with port {}",
                 port.getName());
             return null;
         }
@@ -1403,7 +1403,7 @@ public final class AclServiceUtils {
             // To handle overlapping rules, aclTag is added to priority
             priority += aclTag;
         } else {
-            LOG.warn("aclTag=[] is null or invalid for aclName={}", aclTag, aclName);
+            LOG.warn("aclTag={} is null or invalid for aclName={}", aclTag, aclName);
         }
         return priority;
     }
@@ -1487,7 +1487,7 @@ public final class AclServiceUtils {
         try {
             inetAddress = InetAddress.getByName(addr);
         } catch (UnknownHostException e) {
-            LOG.error("Invalid address : {}", addr, e.getMessage());
+            LOG.error("Invalid address : {}", addr, e);
             return null;
         }
         return inetAddress;
index 892e5cfa41e510899b8f500444659e2ec3712e78..b38097e99ca3fdb43907adfa7644c101a4b8820e 100644 (file)
@@ -168,7 +168,7 @@ public class DisplayAclDataCaches extends OsgiCommandSupport {
                 uuid = Uuid.getDefaultInstance(uuidStr);
             } catch (IllegalArgumentException e) {
                 session.getConsole().println("Invalid uuid" + e.getMessage());
-                log.error("Invalid uuid" + e);
+                log.error("Invalid uuid", e);
                 return;
             }
             Collection<AclInterface> aclInterfaceList = aclDataCache.getInterfaceList(uuid);
@@ -219,7 +219,7 @@ public class DisplayAclDataCaches extends OsgiCommandSupport {
                 uuidRef = Uuid.getDefaultInstance(uuidStr);
             } catch (IllegalArgumentException e) {
                 session.getConsole().println("Invalid uuid" + e.getMessage());
-                log.error("Invalid uuid" + e);
+                log.error("Invalid uuid", e);
                 return;
             }
             Collection<Uuid> remoteUuidLst = aclDataCache.getRemoteAcl(uuidRef, direction);