Repository: incubator-nifi
Updated Branches:
  refs/heads/develop 1a1cfe234 -> 73a368f86


NIFI-560: FileBasedClusterNodeFirewall should use slf4j parameterized message 
instead of string operations.

Signed-off-by: Mark Payne <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/5bf610a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/5bf610a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/5bf610a1

Branch: refs/heads/develop
Commit: 5bf610a11e7bf85770a05e4e1e585a5fdbe85a3a
Parents: 1a1cfe2
Author: Sean Busbey <[email protected]>
Authored: Wed Apr 29 22:02:14 2015 -0500
Committer: Mark Payne <[email protected]>
Committed: Fri May 1 10:46:41 2015 -0400

----------------------------------------------------------------------
 .../firewall/impl/FileBasedClusterNodeFirewall.java | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/5bf610a1/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/firewall/impl/FileBasedClusterNodeFirewall.java
----------------------------------------------------------------------
diff --git 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/firewall/impl/FileBasedClusterNodeFirewall.java
 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/firewall/impl/FileBasedClusterNodeFirewall.java
index 5a0ce8a..8ba33c5 100644
--- 
a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/firewall/impl/FileBasedClusterNodeFirewall.java
+++ 
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/firewall/impl/FileBasedClusterNodeFirewall.java
@@ -101,7 +101,7 @@ public class FileBasedClusterNodeFirewall implements 
ClusterNodeFirewall {
             try {
                 ip = InetAddress.getByName(hostOrIp).getHostAddress();
             } catch (final UnknownHostException uhe) {
-                logger.warn("Blocking unknown host: " + hostOrIp, uhe);
+                logger.warn("Blocking unknown host '{}'", hostOrIp, uhe);
                 return false;
             }
 
@@ -168,30 +168,30 @@ public class FileBasedClusterNodeFirewall implements 
ClusterNodeFirewall {
                 if (ipOrHostLine.contains("/")) {
                     ipCidr = ipOrHostLine;
                 } else if (ipOrHostLine.contains("\\")) {
-                    logger.warn("CIDR IP notation uses forward slashes '/'.  
Replacing backslash '\\' with forward slash'/' for '" + ipOrHostLine + "'");
+                    logger.warn("CIDR IP notation uses forward slashes '/'.  
Replacing backslash '\\' with forward slash'/' for '{}'", ipOrHostLine);
                     ipCidr = ipOrHostLine.replace("\\", "/");
                 } else {
                     try {
                         ipCidr = 
InetAddress.getByName(ipOrHostLine).getHostAddress();
                         if (!ipOrHostLine.equals(ipCidr)) {
-                            logger.debug(String.format("Resolved host '%s' to 
ip '%s'", ipOrHostLine, ipCidr));
+                            logger.debug("Resolved host '{}' to ip '{}'", 
ipOrHostLine, ipCidr);
                         }
                         ipCidr += "/32";
-                        logger.debug("Adding CIDR to exact IP: " + ipCidr);
+                        logger.debug("Adding CIDR to exact IP: '{}'", ipCidr);
                     } catch (final UnknownHostException uhe) {
-                        logger.warn("Firewall is skipping unknown host 
address: " + ipOrHostLine);
+                        logger.warn("Firewall is skipping unknown host 
address: '{}'", ipOrHostLine);
                         continue;
                     }
                 }
 
                 try {
-                    logger.debug("Adding CIDR IP to firewall: " + ipCidr);
+                    logger.debug("Adding CIDR IP to firewall: '{}'", ipCidr);
                     final SubnetUtils subnetUtils = new SubnetUtils(ipCidr);
                     subnetUtils.setInclusiveHostCount(true);
                     subnetInfos.add(subnetUtils.getInfo());
                     totalIpsAdded++;
                 } catch (final IllegalArgumentException iae) {
-                    logger.warn("Firewall is skipping invalid CIDR address: " 
+ ipOrHostLine);
+                    logger.warn("Firewall is skipping invalid CIDR address: 
'{}'", ipOrHostLine);
                 }
 
             }
@@ -199,7 +199,7 @@ public class FileBasedClusterNodeFirewall implements 
ClusterNodeFirewall {
             if (totalIpsAdded == 0) {
                 logger.info("No IPs added to firewall.  Firewall will accept 
all requests.");
             } else {
-                logger.info(String.format("Added %d IP(s) to firewall.  Only 
requests originating from the configured IPs will be accepted.", 
totalIpsAdded));
+                logger.info("Added {} IP(s) to firewall.  Only requests 
originating from the configured IPs will be accepted.", totalIpsAdded);
             }
 
         }

Reply via email to