cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject [14/35] git commit: updated refs/heads/master to 8bc0294
Date Mon, 31 Aug 2015 06:01:34 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc02940/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/HypervisorGuruBase.java b/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
index 880c4f0..fb14dc4 100644
--- a/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
+++ b/server/src/com/cloud/hypervisor/HypervisorGuruBase.java
@@ -22,6 +22,7 @@ import java.util.UUID;
 
 import javax.inject.Inject;
 
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.api.Command;
 import com.cloud.agent.api.to.DiskTO;
@@ -51,6 +52,7 @@ import com.cloud.vm.dao.UserVmDetailsDao;
 import com.cloud.vm.dao.VMInstanceDao;
 
 public abstract class HypervisorGuruBase extends AdapterBase implements HypervisorGuru {
+    public static final Logger s_logger = Logger.getLogger(HypervisorGuruBase.class);
 
     @Inject
     VMTemplateDetailsDao _templateDetailsDao;
@@ -113,7 +115,7 @@ public abstract class HypervisorGuruBase extends AdapterBase implements Hypervis
             }
             to.setNicSecIps(secIps);
         } else {
-            logger.warn("Unabled to load NicVO for NicProfile " + profile.getId());
+            s_logger.warn("Unabled to load NicVO for NicProfile " + profile.getId());
             //Workaround for dynamically created nics
             //FixMe: uuid and secondary IPs can be made part of nic profile
             to.setUuid(UUID.randomUUID().toString());

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc02940/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java b/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
index 909a4f0..ade1b96 100644
--- a/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
+++ b/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
@@ -24,6 +24,7 @@ import javax.annotation.PostConstruct;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
+import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.Command;
@@ -35,6 +36,7 @@ import com.cloud.utils.component.ManagerBase;
 @Component
 @Local(value = {HypervisorGuruManager.class})
 public class HypervisorGuruManagerImpl extends ManagerBase implements HypervisorGuruManager {
+    public static final Logger s_logger = Logger.getLogger(HypervisorGuruManagerImpl.class.getName());
 
     @Inject
     HostDao _hostDao;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc02940/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java b/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
index e55c36d..cf55204 100644
--- a/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
+++ b/server/src/com/cloud/hypervisor/kvm/discoverer/KvmServerDiscoverer.java
@@ -18,12 +18,14 @@ package com.cloud.hypervisor.kvm.discoverer;
 
 import javax.ejb.Local;
 
+import org.apache.log4j.Logger;
 
 import com.cloud.hypervisor.Hypervisor;
 import com.cloud.resource.Discoverer;
 
 @Local(value = Discoverer.class)
 public class KvmServerDiscoverer extends LibvirtServerDiscoverer {
+    private static final Logger s_logger = Logger.getLogger(KvmServerDiscoverer.class);
 
     @Override
     public Hypervisor.HypervisorType getHypervisorType() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc02940/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java b/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
index 26162ce..48be8f2 100644
--- a/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
+++ b/server/src/com/cloud/hypervisor/kvm/discoverer/LibvirtServerDiscoverer.java
@@ -43,6 +43,7 @@ import com.cloud.resource.ResourceStateAdapter;
 import com.cloud.resource.ServerResource;
 import com.cloud.resource.UnableDeleteHostException;
 import com.cloud.utils.ssh.SSHCmdHelper;
+import org.apache.log4j.Logger;
 
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
@@ -54,6 +55,7 @@ import java.util.Map;
 import java.util.UUID;
 
 public abstract class LibvirtServerDiscoverer extends DiscovererBase implements Discoverer, Listener, ResourceStateAdapter {
+    private static final Logger s_logger = Logger.getLogger(LibvirtServerDiscoverer.class);
     private String _hostIp;
     private final int _waitTime = 5; /* wait for 5 minutes */
     private String _kvmPrivateNic;
@@ -117,8 +119,8 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
 
         ClusterVO cluster = _clusterDao.findById(clusterId);
         if (cluster == null || cluster.getHypervisorType() != getHypervisorType()) {
-            if (logger.isInfoEnabled())
-                logger.info("invalid cluster id or cluster is not for " + getHypervisorType() + " hypervisors");
+            if (s_logger.isInfoEnabled())
+                s_logger.info("invalid cluster id or cluster is not for " + getHypervisorType() + " hypervisors");
             return null;
         }
 
@@ -126,7 +128,7 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
         Map<String, String> details = new HashMap<String, String>();
         if (!uri.getScheme().equals("http")) {
             String msg = "urlString is not http so we're not taking care of the discovery for this: " + uri;
-            logger.debug(msg);
+            s_logger.debug(msg);
             return null;
         }
         com.trilead.ssh2.Connection sshConnection = null;
@@ -142,7 +144,7 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
             if (existingHosts != null) {
                 for (HostVO existingHost : existingHosts) {
                     if (existingHost.getGuid().toLowerCase().startsWith(guid.toLowerCase())) {
-                        logger.debug("Skipping " + agentIp + " because " + guid + " is already in the database for resource " + existingHost.getGuid());
+                        s_logger.debug("Skipping " + agentIp + " because " + guid + " is already in the database for resource " + existingHost.getGuid());
                         return null;
                     }
                 }
@@ -152,12 +154,12 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
 
             sshConnection.connect(null, 60000, 60000);
             if (!sshConnection.authenticateWithPassword(username, password)) {
-                logger.debug("Failed to authenticate");
+                s_logger.debug("Failed to authenticate");
                 throw new DiscoveredWithErrorException("Authentication error");
             }
 
             if (!SSHCmdHelper.sshExecuteCmd(sshConnection, "lsmod|grep kvm", 3)) {
-                logger.debug("It's not a KVM enabled machine");
+                s_logger.debug("It's not a KVM enabled machine");
                 return null;
             }
 
@@ -209,7 +211,7 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
             }
             if (!SSHCmdHelper.sshExecuteCmd(sshConnection,
                     setupAgentCommand + parameters, 3)) {
-                logger.info("cloudstack agent setup command failed: "
+                s_logger.info("cloudstack agent setup command failed: "
                         + setupAgentCommand + parameters);
                 return null;
             }
@@ -250,7 +252,7 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
             throw e;
         } catch (Exception e) {
             String msg = " can't setup agent, due to " + e.toString() + " - " + e.getMessage();
-            logger.warn(msg);
+            s_logger.warn(msg);
         } finally {
             if (sshConnection != null)
                 sshConnection.close();
@@ -270,10 +272,10 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
             try {
                 Thread.sleep(30000);
             } catch (InterruptedException e) {
-                logger.debug("Failed to sleep: " + e.toString());
+                s_logger.debug("Failed to sleep: " + e.toString());
             }
         }
-        logger.debug("Timeout, to wait for the host connecting to mgt svr, assuming it is failed");
+        s_logger.debug("Timeout, to wait for the host connecting to mgt svr, assuming it is failed");
         List<HostVO> hosts = _resourceMgr.findHostByGuid(dcId, guid);
         if (hosts.size() == 1) {
             return hosts.get(0);
@@ -342,7 +344,7 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
         /* KVM requires host are the same in cluster */
         ClusterVO clusterVO = _clusterDao.findById(host.getClusterId());
         if (clusterVO == null) {
-            logger.debug("cannot find cluster: " + host.getClusterId());
+            s_logger.debug("cannot find cluster: " + host.getClusterId());
             throw new IllegalArgumentException("cannot add host, due to can't find cluster: " + host.getClusterId());
         }
 
@@ -380,9 +382,9 @@ public abstract class LibvirtServerDiscoverer extends DiscovererBase implements
             ShutdownCommand cmd = new ShutdownCommand(ShutdownCommand.DeleteHost, null);
             _agentMgr.send(host.getId(), cmd);
         } catch (AgentUnavailableException e) {
-            logger.warn("Sending ShutdownCommand failed: ", e);
+            s_logger.warn("Sending ShutdownCommand failed: ", e);
         } catch (OperationTimedoutException e) {
-            logger.warn("Sending ShutdownCommand failed: ", e);
+            s_logger.warn("Sending ShutdownCommand failed: ", e);
         }
 
         return new DeleteHostAnswer(true);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc02940/server/src/com/cloud/hypervisor/kvm/discoverer/LxcServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/kvm/discoverer/LxcServerDiscoverer.java b/server/src/com/cloud/hypervisor/kvm/discoverer/LxcServerDiscoverer.java
index 31d4314..dff89c8 100644
--- a/server/src/com/cloud/hypervisor/kvm/discoverer/LxcServerDiscoverer.java
+++ b/server/src/com/cloud/hypervisor/kvm/discoverer/LxcServerDiscoverer.java
@@ -18,12 +18,14 @@ package com.cloud.hypervisor.kvm.discoverer;
 
 import javax.ejb.Local;
 
+import org.apache.log4j.Logger;
 
 import com.cloud.hypervisor.Hypervisor;
 import com.cloud.resource.Discoverer;
 
 @Local(value = Discoverer.class)
 public class LxcServerDiscoverer extends LibvirtServerDiscoverer {
+    private static final Logger s_logger = Logger.getLogger(LxcServerDiscoverer.class);
 
     @Override
     public Hypervisor.HypervisorType getHypervisorType() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc02940/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
index e368cd0..812630a 100644
--- a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
+++ b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java
@@ -45,6 +45,7 @@ import org.apache.cloudstack.resourcedetail.dao.LBStickinessPolicyDetailsDao;
 import org.apache.cloudstack.resourcedetail.dao.LBHealthCheckPolicyDetailsDao;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao;
 
+import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.dao.DataCenterDetailsDao;
@@ -69,6 +70,7 @@ import com.cloud.vm.dao.UserVmDetailsDao;
 @Component
 @Local(value = {ResourceMetaDataService.class, ResourceMetaDataManager.class})
 public class ResourceMetaDataManagerImpl extends ManagerBase implements ResourceMetaDataService, ResourceMetaDataManager {
+    public static final Logger s_logger = Logger.getLogger(ResourceMetaDataManagerImpl.class);
     @Inject
     VolumeDetailsDao _volumeDetailDao;
     @Inject

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc02940/server/src/com/cloud/network/ExternalDeviceUsageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalDeviceUsageManagerImpl.java b/server/src/com/cloud/network/ExternalDeviceUsageManagerImpl.java
index 54e74da..9e53341 100644
--- a/server/src/com/cloud/network/ExternalDeviceUsageManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalDeviceUsageManagerImpl.java
@@ -31,6 +31,7 @@ import javax.naming.ConfigurationException;
 
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.managed.context.ManagedContextRunnable;
+import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
@@ -152,6 +153,7 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
 
     ScheduledExecutorService _executor;
     private int _externalNetworkStatsInterval;
+    private static final org.apache.log4j.Logger s_logger = Logger.getLogger(ExternalDeviceUsageManagerImpl.class);
 
     @Override
     public boolean configure(String name, Map<String, Object> params) throws ConfigurationException {
@@ -208,24 +210,24 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
 
         LoadBalancerVO lb = _loadBalancerDao.findById(loadBalancerRuleId);
         if (lb == null) {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Cannot update usage stats, LB rule is not found");
+            if (s_logger.isDebugEnabled()) {
+                s_logger.debug("Cannot update usage stats, LB rule is not found");
             }
             return;
         }
         long networkId = lb.getNetworkId();
         Network network = _networkDao.findById(networkId);
         if (network == null) {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Cannot update usage stats, Network is not found");
+            if (s_logger.isDebugEnabled()) {
+                s_logger.debug("Cannot update usage stats, Network is not found");
             }
             return;
         }
 
         ExternalLoadBalancerDeviceVO lbDeviceVO = getExternalLoadBalancerForNetwork(network);
         if (lbDeviceVO == null) {
-            if (logger.isDebugEnabled()) {
-                logger.debug("Cannot update usage stats,  No external LB device found");
+            if (s_logger.isDebugEnabled()) {
+                s_logger.debug("Cannot update usage stats,  No external LB device found");
             }
             return;
         }
@@ -239,7 +241,7 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
             if (lbAnswer == null || !lbAnswer.getResult()) {
                 String details = (lbAnswer != null) ? lbAnswer.getDetails() : "details unavailable";
                 String msg = "Unable to get external load balancer stats for network" + networkId + " due to: " + details + ".";
-                logger.error(msg);
+                s_logger.error(msg);
                 return;
             }
         }
@@ -247,7 +249,7 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
         long accountId = lb.getAccountId();
         AccountVO account = _accountDao.findById(accountId);
         if (account == null) {
-            logger.debug("Skipping stats update for external LB for account with ID " + accountId);
+            s_logger.debug("Skipping stats update for external LB for account with ID " + accountId);
             return;
         }
 
@@ -281,7 +283,7 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
             }
 
             if (bytesSentAndReceived == null) {
-                logger.debug("Didn't get an external network usage answer for public IP " + publicIp);
+                s_logger.debug("Didn't get an external network usage answer for public IP " + publicIp);
             } else {
                 newCurrentBytesSent += bytesSentAndReceived[0];
                 newCurrentBytesReceived += bytesSentAndReceived[1];
@@ -310,23 +312,23 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
 
                     userStats.setCurrentBytesSent(newCurrentBytesSent);
                     if (oldCurrentBytesSent > newCurrentBytesSent) {
-                        logger.warn(warning + "Stored bytes sent: " + oldCurrentBytesSent + ", new bytes sent: " + newCurrentBytesSent + ".");
+                        s_logger.warn(warning + "Stored bytes sent: " + oldCurrentBytesSent + ", new bytes sent: " + newCurrentBytesSent + ".");
                         userStats.setNetBytesSent(oldNetBytesSent + oldCurrentBytesSent);
                     }
 
                     userStats.setCurrentBytesReceived(newCurrentBytesReceived);
                     if (oldCurrentBytesReceived > newCurrentBytesReceived) {
-                        logger.warn(warning + "Stored bytes received: " + oldCurrentBytesReceived + ", new bytes received: " + newCurrentBytesReceived + ".");
+                        s_logger.warn(warning + "Stored bytes received: " + oldCurrentBytesReceived + ", new bytes received: " + newCurrentBytesReceived + ".");
                         userStats.setNetBytesReceived(oldNetBytesReceived + oldCurrentBytesReceived);
                     }
 
                     if (_userStatsDao.update(userStats.getId(), userStats)) {
-                        logger.debug("Successfully updated stats for " + statsEntryIdentifier);
+                        s_logger.debug("Successfully updated stats for " + statsEntryIdentifier);
                     } else {
-                        logger.debug("Failed to update stats for " + statsEntryIdentifier);
+                        s_logger.debug("Failed to update stats for " + statsEntryIdentifier);
                     }
                 } else {
-                    logger.warn("Unable to find user stats entry for " + statsEntryIdentifier);
+                    s_logger.warn("Unable to find user stats entry for " + statsEntryIdentifier);
                 }
             }
         });
@@ -350,14 +352,14 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
                     }
                 }
             } catch (Exception e) {
-                logger.warn("Problems while getting external device usage", e);
+                s_logger.warn("Problems while getting external device usage", e);
             } finally {
                 scanLock.releaseRef();
             }
         }
 
         private void runExternalDeviceNetworkUsageTask() {
-            logger.debug("External devices stats collector is running...");
+            s_logger.debug("External devices stats collector is running...");
 
             for (DataCenterVO zone : _dcDao.listAll()) {
                 List<DomainRouterVO> domainRoutersInZone = _routerDao.listByDataCenter(zone.getId());
@@ -372,8 +374,8 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
                     long accountId = domainRouter.getAccountId();
 
                     if (accountsProcessed.contains(new Long(accountId))) {
-                        if (logger.isTraceEnabled()) {
-                            logger.trace("Networks for Account " + accountId + " are already processed for external network usage, so skipping usage check.");
+                        if (s_logger.isTraceEnabled()) {
+                            s_logger.trace("Networks for Account " + accountId + " are already processed for external network usage, so skipping usage check.");
                         }
                         continue;
                     }
@@ -387,7 +389,7 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
 
                     for (NetworkVO network : networksForAccount) {
                         if (!_networkModel.networkIsConfiguredForExternalNetworking(zoneId, network.getId())) {
-                            logger.debug("Network " + network.getId() + " is not configured for external networking, so skipping usage check.");
+                            s_logger.debug("Network " + network.getId() + " is not configured for external networking, so skipping usage check.");
                             continue;
                         }
 
@@ -411,17 +413,17 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
                                         if (firewallAnswer == null || !firewallAnswer.getResult()) {
                                             String details = (firewallAnswer != null) ? firewallAnswer.getDetails() : "details unavailable";
                                             String msg = "Unable to get external firewall stats for network" + zone.getName() + " due to: " + details + ".";
-                                            logger.error(msg);
+                                            s_logger.error(msg);
                                         } else {
                                             fwDeviceUsageAnswerMap.put(fwDeviceId, firewallAnswer);
                                         }
                                     } catch (Exception e) {
                                         String msg = "Unable to get external firewall stats for network" + zone.getName();
-                                        logger.error(msg, e);
+                                        s_logger.error(msg, e);
                                     }
                                 } else {
-                                    if (logger.isTraceEnabled()) {
-                                        logger.trace("Reusing usage Answer for device id " + fwDeviceId + "for Network " + network.getId());
+                                    if (s_logger.isTraceEnabled()) {
+                                        s_logger.trace("Reusing usage Answer for device id " + fwDeviceId + "for Network " + network.getId());
                                     }
                                     firewallAnswer = fwDeviceUsageAnswerMap.get(fwDeviceId);
                                 }
@@ -442,17 +444,17 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
                                         if (lbAnswer == null || !lbAnswer.getResult()) {
                                             String details = (lbAnswer != null) ? lbAnswer.getDetails() : "details unavailable";
                                             String msg = "Unable to get external load balancer stats for " + zone.getName() + " due to: " + details + ".";
-                                            logger.error(msg);
+                                            s_logger.error(msg);
                                         } else {
                                             lbDeviceUsageAnswerMap.put(lbDeviceId, lbAnswer);
                                         }
                                     } catch (Exception e) {
                                         String msg = "Unable to get external load balancer stats for " + zone.getName();
-                                        logger.error(msg, e);
+                                        s_logger.error(msg, e);
                                     }
                                 } else {
-                                    if (logger.isTraceEnabled()) {
-                                        logger.trace("Reusing usage Answer for device id " + lbDeviceId + "for Network " + network.getId());
+                                    if (s_logger.isTraceEnabled()) {
+                                        s_logger.trace("Reusing usage Answer for device id " + lbDeviceId + "for Network " + network.getId());
                                     }
                                     lbAnswer = lbDeviceUsageAnswerMap.get(lbDeviceId);
                                 }
@@ -465,7 +467,7 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
 
                         AccountVO account = _accountDao.findById(accountId);
                         if (account == null) {
-                            logger.debug("Skipping stats update for account with ID " + accountId);
+                            s_logger.debug("Skipping stats update for account with ID " + accountId);
                             continue;
                         }
 
@@ -492,13 +494,13 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
 
             userStats.setCurrentBytesSent(newCurrentBytesSent);
             if (oldCurrentBytesSent > newCurrentBytesSent) {
-                logger.warn(warning + "Stored bytes sent: " + oldCurrentBytesSent + ", new bytes sent: " + newCurrentBytesSent + ".");
+                s_logger.warn(warning + "Stored bytes sent: " + oldCurrentBytesSent + ", new bytes sent: " + newCurrentBytesSent + ".");
                 userStats.setNetBytesSent(oldNetBytesSent + oldCurrentBytesSent);
             }
 
             userStats.setCurrentBytesReceived(newCurrentBytesReceived);
             if (oldCurrentBytesReceived > newCurrentBytesReceived) {
-                logger.warn(warning + "Stored bytes received: " + oldCurrentBytesReceived + ", new bytes received: " + newCurrentBytesReceived + ".");
+                s_logger.warn(warning + "Stored bytes received: " + oldCurrentBytesReceived + ", new bytes received: " + newCurrentBytesReceived + ".");
                 userStats.setNetBytesReceived(oldNetBytesReceived + oldCurrentBytesReceived);
             }
 
@@ -551,7 +553,7 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
                 }
 
                 if (bytesSentAndReceived == null) {
-                    logger.debug("Didn't get an external network usage answer for public IP " + publicIp);
+                    s_logger.debug("Didn't get an external network usage answer for public IP " + publicIp);
                 } else {
                     newCurrentBytesSent += bytesSentAndReceived[0];
                     newCurrentBytesReceived += bytesSentAndReceived[1];
@@ -559,14 +561,14 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
             } else {
                 URI broadcastURI = network.getBroadcastUri();
                 if (broadcastURI == null) {
-                    logger.debug("Not updating stats for guest network with ID " + network.getId() + " because the network is not implemented.");
+                    s_logger.debug("Not updating stats for guest network with ID " + network.getId() + " because the network is not implemented.");
                     return true;
                 } else {
                     long vlanTag = Integer.parseInt(BroadcastDomainType.getValue(broadcastURI));
                     long[] bytesSentAndReceived = answer.guestVlanBytes.get(String.valueOf(vlanTag));
 
                     if (bytesSentAndReceived == null) {
-                        logger.warn("Didn't get an external network usage answer for guest VLAN " + vlanTag);
+                        s_logger.warn("Didn't get an external network usage answer for guest VLAN " + vlanTag);
                     } else {
                         newCurrentBytesSent += bytesSentAndReceived[0];
                         newCurrentBytesReceived += bytesSentAndReceived[1];
@@ -578,15 +580,15 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
             try {
                 userStats = _userStatsDao.lock(accountId, zoneId, networkId, publicIp, hostId, host.getType().toString());
             } catch (Exception e) {
-                logger.warn("Unable to find user stats entry for " + statsEntryIdentifier);
+                s_logger.warn("Unable to find user stats entry for " + statsEntryIdentifier);
                 return false;
             }
 
             if (updateBytes(userStats, newCurrentBytesSent, newCurrentBytesReceived)) {
-                logger.debug("Successfully updated stats for " + statsEntryIdentifier);
+                s_logger.debug("Successfully updated stats for " + statsEntryIdentifier);
                 return true;
             } else {
-                logger.debug("Failed to update stats for " + statsEntryIdentifier);
+                s_logger.debug("Failed to update stats for " + statsEntryIdentifier);
                 return false;
             }
         }
@@ -674,7 +676,7 @@ public class ExternalDeviceUsageManagerImpl extends ManagerBase implements Exter
                 });
                 return true;
             } catch (Exception e) {
-                logger.warn("Exception: ", e);
+                s_logger.warn("Exception: ", e);
                 return false;
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc02940/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
index 1d426e3..f0d8622 100644
--- a/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalFirewallDeviceManagerImpl.java
@@ -30,6 +30,7 @@ import org.apache.cloudstack.api.response.ExternalFirewallResponse;
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -173,6 +174,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
     @Inject
     FirewallRulesDao _fwRulesDao;
 
+    private static final org.apache.log4j.Logger s_logger = Logger.getLogger(ExternalFirewallDeviceManagerImpl.class);
     private long _defaultFwCapacity;
 
     @Override
@@ -217,7 +219,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
         try {
             uri = new URI(url);
         } catch (Exception e) {
-            logger.debug(e);
+            s_logger.debug(e);
             throw new InvalidParameterValueException(e.getMessage());
         }
 
@@ -300,7 +302,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
             _externalFirewallDeviceDao.remove(fwDeviceId);
             return true;
         } catch (Exception e) {
-            logger.debug("Failed to delete external firewall device due to " + e.getMessage());
+            s_logger.debug("Failed to delete external firewall device due to " + e.getMessage());
             return false;
         }
     }
@@ -386,7 +388,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
                         _networkExternalFirewallDao.remove(fwDeviceForNetwork.getId());
                     }
                 } catch (Exception exception) {
-                    logger.error("Failed to release firewall device for the network" + network.getId() + " due to " + exception.getMessage());
+                    s_logger.error("Failed to release firewall device for the network" + network.getId() + " due to " + exception.getMessage());
                     return false;
                 } finally {
                     deviceMapLock.unlock();
@@ -421,7 +423,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
     @Override
     public boolean manageGuestNetworkWithExternalFirewall(boolean add, Network network) throws ResourceUnavailableException, InsufficientCapacityException {
         if (network.getTrafficType() != TrafficType.Guest) {
-            logger.trace("External firewall can only be used for add/remove guest networks.");
+            s_logger.trace("External firewall can only be used for add/remove guest networks.");
             return false;
         }
 
@@ -451,7 +453,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
         } else {
             ExternalFirewallDeviceVO fwDeviceVO = getExternalFirewallForNetwork(network);
             if (fwDeviceVO == null) {
-                logger.warn("Network shutdown requested on external firewall element, which did not implement the network."
+                s_logger.warn("Network shutdown requested on external firewall element, which did not implement the network."
                     + " Either network implement failed half way through or already network shutdown is completed.");
                 return true;
             }
@@ -476,7 +478,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
             }
             if (sourceNatIp == null) {
                 String errorMsg = "External firewall was unable to find the source NAT IP address for network " + network.getName();
-                logger.error(errorMsg);
+                s_logger.error(errorMsg);
                 return true;
             }
         }
@@ -513,10 +515,10 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
             String answerDetails = (answer != null) ? answer.getDetails() : "answer was null";
             String msg =
                 "External firewall was unable to " + action + " the guest network on the external firewall in zone " + zone.getName() + " due to " + answerDetails;
-            logger.error(msg);
+            s_logger.error(msg);
             if (!add && (!reservedIpAddressesForGuestNetwork.contains(network.getGateway()))) {
                 // If we failed the implementation as well, then just return, no complain
-                logger.error("Skip the shutdown of guest network on SRX because it seems we didn't implement it as well");
+                s_logger.error("Skip the shutdown of guest network on SRX because it seems we didn't implement it as well");
                 return true;
             }
             throw new ResourceUnavailableException(msg, DataCenter.class, zoneId);
@@ -543,7 +545,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
             List<NicVO> nics = _nicDao.listByNetworkId(network.getId());
             for (NicVO nic : nics) {
                 if (nic.getVmType() == null && nic.getReservationStrategy().equals(ReservationStrategy.PlaceHolder) && nic.getIPv4Address().equals(network.getGateway())) {
-                    logger.debug("Removing placeholder nic " + nic + " for the network " + network);
+                    s_logger.debug("Removing placeholder nic " + nic + " for the network " + network);
                     _nicDao.remove(nic.getId());
                 }
             }
@@ -551,7 +553,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
         }
 
         String action = add ? "implemented" : "shut down";
-        logger.debug("External firewall has " + action + " the guest network for account " + account.getAccountName() + "(id = " + account.getAccountId() +
+        s_logger.debug("External firewall has " + action + " the guest network for account " + account.getAccountName() + "(id = " + account.getAccountId() +
             ") with VLAN tag " + guestVlanTag);
 
         return true;
@@ -572,7 +574,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
         assert (externalFirewall != null);
 
         if (network.getState() == Network.State.Allocated) {
-            logger.debug("External firewall was asked to apply firewall rules for network with ID " + network.getId() +
+            s_logger.debug("External firewall was asked to apply firewall rules for network with ID " + network.getId() +
                 "; this network is not implemented. Skipping backend commands.");
             return true;
         }
@@ -615,7 +617,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
         assert (externalFirewall != null);
 
         if (network.getState() == Network.State.Allocated) {
-            logger.debug("External firewall was asked to apply firewall rules for network with ID " + network.getId() +
+            s_logger.debug("External firewall was asked to apply firewall rules for network with ID " + network.getId() +
                 "; this network is not implemented. Skipping backend commands.");
             return true;
         }
@@ -643,7 +645,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
             if (answer == null || !answer.getResult()) {
                 String details = (answer != null) ? answer.getDetails() : "details unavailable";
                 String msg = "External firewall was unable to apply static nat rules to the SRX appliance in zone " + zone.getName() + " due to: " + details + ".";
-                logger.error(msg);
+                s_logger.error(msg);
                 throw new ResourceUnavailableException(msg, DataCenter.class, zone.getId());
             }
         }
@@ -656,7 +658,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
             if (answer == null || !answer.getResult()) {
                 String details = (answer != null) ? answer.getDetails() : "details unavailable";
                 String msg = "External firewall was unable to apply static nat rules to the SRX appliance in zone " + zone.getName() + " due to: " + details + ".";
-                logger.error(msg);
+                s_logger.error(msg);
                 throw new ResourceUnavailableException(msg, DataCenter.class, zone.getId());
             }
         }
@@ -669,7 +671,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
             if (answer == null || !answer.getResult()) {
                 String details = (answer != null) ? answer.getDetails() : "details unavailable";
                 String msg = "External firewall was unable to apply port forwarding rules to the SRX appliance in zone " + zone.getName() + " due to: " + details + ".";
-                logger.error(msg);
+                s_logger.error(msg);
                 throw new ResourceUnavailableException(msg, DataCenter.class, zone.getId());
             }
         }
@@ -711,7 +713,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
         if (answer == null || !answer.getResult()) {
             String details = (answer != null) ? answer.getDetails() : "details unavailable";
             String msg = "External firewall was unable to create a remote access VPN in zone " + zone.getName() + " due to: " + details + ".";
-            logger.error(msg);
+            s_logger.error(msg);
             throw new ResourceUnavailableException(msg, DataCenter.class, zone.getId());
         }
 
@@ -747,7 +749,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
             String details = (answer != null) ? answer.getDetails() : "details unavailable";
             DataCenterVO zone = _dcDao.findById(network.getDataCenterId());
             String msg = "External firewall was unable to add remote access users in zone " + zone.getName() + " due to: " + details + ".";
-            logger.error(msg);
+            s_logger.error(msg);
             throw new ResourceUnavailableException(msg, DataCenter.class, zone.getId());
         }
 
@@ -820,7 +822,7 @@ public abstract class ExternalFirewallDeviceManagerImpl extends AdapterBase impl
         assert (externalFirewall != null);
 
         if (network.getState() == Network.State.Allocated) {
-            logger.debug("External firewall was asked to apply firewall rules for network with ID " + network.getId() +
+            s_logger.debug("External firewall was asked to apply firewall rules for network with ID " + network.getId() +
                 "; this network is not implemented. Skipping backend commands.");
             return true;
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc02940/server/src/com/cloud/network/ExternalIpAddressAllocator.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalIpAddressAllocator.java b/server/src/com/cloud/network/ExternalIpAddressAllocator.java
index 7dc4f90..58b30f4 100644
--- a/server/src/com/cloud/network/ExternalIpAddressAllocator.java
+++ b/server/src/com/cloud/network/ExternalIpAddressAllocator.java
@@ -30,6 +30,7 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 
@@ -40,6 +41,7 @@ import com.cloud.utils.exception.CloudRuntimeException;
 
 @Local(value = IpAddrAllocator.class)
 public class ExternalIpAddressAllocator extends AdapterBase implements IpAddrAllocator {
+    private static final Logger s_logger = Logger.getLogger(ExternalIpAddressAllocator.class);
     @Inject
     ConfigurationDao _configDao = null;
     @Inject
@@ -55,7 +57,7 @@ public class ExternalIpAddressAllocator extends AdapterBase implements IpAddrAll
             return new IpAddr();
         }
         String urlString = _externalIpAllocatorUrl + "?command=getIpAddr&mac=" + macAddr + "&dc=" + dcId + "&pod=" + podId;
-        logger.debug("getIP:" + urlString);
+        s_logger.debug("getIP:" + urlString);
 
         BufferedReader in = null;
         try {
@@ -66,10 +68,10 @@ public class ExternalIpAddressAllocator extends AdapterBase implements IpAddrAll
             in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
             String inputLine;
             while ((inputLine = in.readLine()) != null) {
-                logger.debug(inputLine);
+                s_logger.debug(inputLine);
                 String[] tokens = inputLine.split(",");
                 if (tokens.length != 3) {
-                    logger.debug("the return value should be: mac,netmask,gateway");
+                    s_logger.debug("the return value should be: mac,netmask,gateway");
                     return new IpAddr();
                 }
                 return new IpAddr(tokens[0], tokens[1], tokens[2]);
@@ -101,7 +103,7 @@ public class ExternalIpAddressAllocator extends AdapterBase implements IpAddrAll
 
         String urlString = _externalIpAllocatorUrl + "?command=releaseIpAddr&ip=" + ip + "&dc=" + dcId + "&pod=" + podId;
 
-        logger.debug("releaseIP:" + urlString);
+        s_logger.debug("releaseIP:" + urlString);
         BufferedReader in = null;
         try {
             URL url = new URL(urlString);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc02940/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
index f94190b..d7ee2b6 100644
--- a/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalLoadBalancerDeviceManagerImpl.java
@@ -32,6 +32,7 @@ import org.apache.cloudstack.api.response.ExternalLoadBalancerResponse;
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
+import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -192,6 +193,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
     IpAddressManager _ipAddrMgr;
 
     private long _defaultLbCapacity;
+    private static final org.apache.log4j.Logger s_logger = Logger.getLogger(ExternalLoadBalancerDeviceManagerImpl.class);
 
     @Override
     @DB
@@ -238,7 +240,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
         try {
             uri = new URI(url);
         } catch (Exception e) {
-            logger.debug(e);
+            s_logger.debug(e);
             throw new InvalidParameterValueException(e.getMessage());
         }
 
@@ -342,7 +344,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
 
             return true;
         } catch (Exception e) {
-            logger.debug(e);
+            s_logger.debug(e);
             return false;
         }
     }
@@ -454,7 +456,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                             if (tryLbProvisioning) {
                                 retry = false;
                                 // TODO: throwing warning instead of error for now as its possible another provider can service this network
-                                logger.warn("There are no load balancer device with the capacity for implementing this network");
+                                s_logger.warn("There are no load balancer device with the capacity for implementing this network");
                                 throw exception;
                             } else {
                                 tryLbProvisioning = true; // if possible provision a LB appliance in to the physical network
@@ -493,11 +495,11 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                             try {
                                 createLbAnswer = (CreateLoadBalancerApplianceAnswer)_agentMgr.easySend(lbProviderDevice.getHostId(), lbProvisionCmd);
                                 if (createLbAnswer == null || !createLbAnswer.getResult()) {
-                                    logger.error("Could not provision load balancer instance on the load balancer device " + lbProviderDevice.getId());
+                                    s_logger.error("Could not provision load balancer instance on the load balancer device " + lbProviderDevice.getId());
                                     continue;
                                 }
                             } catch (Exception agentException) {
-                                logger.error("Could not provision load balancer instance on the load balancer device " + lbProviderDevice.getId() + " due to " +
+                                s_logger.error("Could not provision load balancer instance on the load balancer device " + lbProviderDevice.getId() + " due to " +
                                     agentException.getMessage());
                                 continue;
                             }
@@ -522,7 +524,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                             try {
                                 publicIPVlanTag = BroadcastDomainType.getValue(publicIp.getVlanTag());
                             } catch (URISyntaxException e) {
-                                logger.error("Failed to parse public ip vlan tag" + e.getMessage());
+                                s_logger.error("Failed to parse public ip vlan tag" + e.getMessage());
                             }
 
                             String url =
@@ -535,7 +537,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                                     addExternalLoadBalancer(physicalNetworkId, url, username, password, createLbAnswer.getDeviceName(),
                                         createLbAnswer.getServerResource(), false, false, null, null);
                             } catch (Exception e) {
-                                logger.error("Failed to add load balancer appliance in to cloudstack due to " + e.getMessage() +
+                                s_logger.error("Failed to add load balancer appliance in to cloudstack due to " + e.getMessage() +
                                     ". So provisioned load balancer appliance will be destroyed.");
                             }
 
@@ -552,14 +554,14 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                                 try {
                                     answer = (DestroyLoadBalancerApplianceAnswer)_agentMgr.easySend(lbProviderDevice.getHostId(), lbDeleteCmd);
                                     if (answer == null || !answer.getResult()) {
-                                        logger.warn("Failed to destroy load balancer appliance created");
+                                        s_logger.warn("Failed to destroy load balancer appliance created");
                                     } else {
                                         // release the public & private IP back to dc pool, as the load balancer appliance is now destroyed
                                         _dcDao.releasePrivateIpAddress(lbIP, guestConfig.getDataCenterId(), null);
                                         _ipAddrMgr.disassociatePublicIpAddress(publicIp.getId(), _accountMgr.getSystemUser().getId(), _accountMgr.getSystemAccount());
                                     }
                                 } catch (Exception e) {
-                                    logger.warn("Failed to destroy load balancer appliance created for the network" + guestConfig.getId() + " due to " + e.getMessage());
+                                    s_logger.warn("Failed to destroy load balancer appliance created for the network" + guestConfig.getId() + " due to " + e.getMessage());
                                 }
                             }
                         }
@@ -694,16 +696,16 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                     try {
                         answer = (DestroyLoadBalancerApplianceAnswer)_agentMgr.easySend(lbDevice.getParentHostId(), lbDeleteCmd);
                         if (answer == null || !answer.getResult()) {
-                            logger.warn("Failed to destoy load balancer appliance used by the network"
+                            s_logger.warn("Failed to destoy load balancer appliance used by the network"
                                     + guestConfig.getId() + " due to " + answer == null ? "communication error with agent"
                                     : answer.getDetails());
                         }
                     } catch (Exception e) {
-                        logger.warn("Failed to destroy load balancer appliance used by the network" + guestConfig.getId() + " due to " + e.getMessage());
+                        s_logger.warn("Failed to destroy load balancer appliance used by the network" + guestConfig.getId() + " due to " + e.getMessage());
                     }
 
-                    if (logger.isDebugEnabled()) {
-                        logger.debug("Successfully destroyed load balancer appliance used for the network" + guestConfig.getId());
+                    if (s_logger.isDebugEnabled()) {
+                        s_logger.debug("Successfully destroyed load balancer appliance used for the network" + guestConfig.getId());
                     }
                     deviceMapLock.unlock();
 
@@ -723,11 +725,11 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
 
                 return true;
             } else {
-                logger.error("Failed to release load balancer device for the network" + guestConfig.getId() + "as failed to acquire lock ");
+                s_logger.error("Failed to release load balancer device for the network" + guestConfig.getId() + "as failed to acquire lock ");
                 return false;
             }
         } catch (Exception exception) {
-            logger.error("Failed to release load balancer device for the network" + guestConfig.getId() + " due to " + exception.getMessage());
+            s_logger.error("Failed to release load balancer device for the network" + guestConfig.getId() + " due to " + exception.getMessage());
         } finally {
             deviceMapLock.releaseRef();
         }
@@ -793,7 +795,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                             loadBalancingIpAddress = directIp.getAddress().addr();
                         } catch (InsufficientCapacityException capException) {
                             String msg = "Ran out of guest IP addresses from the shared network.";
-                            logger.error(msg);
+                            s_logger.error(msg);
                             throw new ResourceUnavailableException(msg, DataCenter.class, network.getDataCenterId());
                         }
                     }
@@ -801,7 +803,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
 
                 if (loadBalancingIpAddress == null) {
                     String msg = "Ran out of guest IP addresses.";
-                    logger.error(msg);
+                    s_logger.error(msg);
                     throw new ResourceUnavailableException(msg, DataCenter.class, network.getDataCenterId());
                 }
 
@@ -826,7 +828,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                     throw ex;
                 }
 
-                logger.debug("Created static nat rule for inline load balancer");
+                s_logger.debug("Created static nat rule for inline load balancer");
                 nic.setState(MappingState.Create);
             } else {
                 loadBalancingIpNic = _nicDao.findById(mapping.getNicId());
@@ -848,11 +850,11 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                     // Delete the NIC
                     _nicDao.expunge(loadBalancingIpNic.getId());
 
-                    logger.debug("Revoked static nat rule for inline load balancer");
+                    s_logger.debug("Revoked static nat rule for inline load balancer");
                     nic.setState(MappingState.Remove);
                 }
             } else {
-                logger.debug("Revoking a rule for an inline load balancer that has not been programmed yet.");
+                s_logger.debug("Revoking a rule for an inline load balancer that has not been programmed yet.");
                 nic.setNic(null);
                 return nic;
             }
@@ -874,7 +876,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
 
         ExternalLoadBalancerDeviceVO lbDeviceVO = getExternalLoadBalancerForNetwork(network);
         if (lbDeviceVO == null) {
-            logger.warn("There is no external load balancer device assigned to this network either network is not implement are already shutdown so just returning");
+            s_logger.warn("There is no external load balancer device assigned to this network either network is not implement are already shutdown so just returning");
             return true;
         }
 
@@ -883,7 +885,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
         boolean externalLoadBalancerIsInline = _networkMgr.isNetworkInlineMode(network);
 
         if (network.getState() == Network.State.Allocated) {
-            logger.debug("External load balancer was asked to apply LB rules for network with ID " + network.getId() +
+            s_logger.debug("External load balancer was asked to apply LB rules for network with ID " + network.getId() +
                 "; this network is not implemented. Skipping backend commands.");
             return true;
         }
@@ -937,13 +939,13 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                 if (answer == null || !answer.getResult()) {
                     String details = (answer != null) ? answer.getDetails() : "details unavailable";
                     String msg = "Unable to apply load balancer rules to the external load balancer appliance in zone " + zone.getName() + " due to: " + details + ".";
-                    logger.error(msg);
+                    s_logger.error(msg);
                     throw new ResourceUnavailableException(msg, DataCenter.class, network.getDataCenterId());
                 }
             }
         } catch (Exception ex) {
             if (externalLoadBalancerIsInline) {
-                logger.error("Rollbacking static nat operation of inline mode load balancing due to error on applying LB rules!");
+                s_logger.error("Rollbacking static nat operation of inline mode load balancing due to error on applying LB rules!");
                 String existedGuestIp = loadBalancersToApply.get(0).getSrcIp();
                 // Rollback static NAT operation in current session
                 for (int i = 0; i < loadBalancingRules.size(); i++) {
@@ -970,7 +972,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
     @Override
     public boolean manageGuestNetworkWithExternalLoadBalancer(boolean add, Network guestConfig) throws ResourceUnavailableException, InsufficientCapacityException {
         if (guestConfig.getTrafficType() != TrafficType.Guest) {
-            logger.trace("External load balancer can only be used for guest networks.");
+            s_logger.trace("External load balancer can only be used for guest networks.");
             return false;
         }
 
@@ -987,17 +989,17 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                 lbDeviceVO = allocateLoadBalancerForNetwork(guestConfig);
                 if (lbDeviceVO == null) {
                     String msg = "failed to alloacate a external load balancer for the network " + guestConfig.getId();
-                    logger.error(msg);
+                    s_logger.error(msg);
                     throw new InsufficientNetworkCapacityException(msg, DataCenter.class, guestConfig.getDataCenterId());
                 }
             }
             externalLoadBalancer = _hostDao.findById(lbDeviceVO.getHostId());
-            logger.debug("Allocated external load balancer device:" + lbDeviceVO.getId() + " for the network: " + guestConfig.getId());
+            s_logger.debug("Allocated external load balancer device:" + lbDeviceVO.getId() + " for the network: " + guestConfig.getId());
         } else {
             // find the load balancer device allocated for the network
             ExternalLoadBalancerDeviceVO lbDeviceVO = getExternalLoadBalancerForNetwork(guestConfig);
             if (lbDeviceVO == null) {
-                logger.warn("Network shutdwon requested on external load balancer element, which did not implement the network."
+                s_logger.warn("Network shutdwon requested on external load balancer element, which did not implement the network."
                     + " Either network implement failed half way through or already network shutdown is completed. So just returning.");
                 return true;
             }
@@ -1023,14 +1025,14 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
             selfIp = _ipAddrMgr.acquireGuestIpAddress(guestConfig, null);
             if (selfIp == null) {
                 String msg = "failed to acquire guest IP address so not implementing the network on the external load balancer ";
-                logger.error(msg);
+                s_logger.error(msg);
                 throw new InsufficientNetworkCapacityException(msg, Network.class, guestConfig.getId());
             }
         } else {
             // get the self-ip used by the load balancer
             Nic selfipNic = getPlaceholderNic(guestConfig);
             if (selfipNic == null) {
-                logger.warn("Network shutdwon requested on external load balancer element, which did not implement the network."
+                s_logger.warn("Network shutdwon requested on external load balancer element, which did not implement the network."
                     + " Either network implement failed half way through or already network shutdown is completed. So just returning.");
                 return true;
             }
@@ -1051,7 +1053,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
             String answerDetails = (answer != null) ? answer.getDetails() : null;
             answerDetails = (answerDetails != null) ? " due to " + answerDetails : "";
             String msg = "External load balancer was unable to " + action + " the guest network on the external load balancer in zone " + zone.getName() + answerDetails;
-            logger.error(msg);
+            s_logger.error(msg);
             throw new ResourceUnavailableException(msg, Network.class, guestConfig.getId());
         }
 
@@ -1067,14 +1069,14 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
             boolean releasedLB = freeLoadBalancerForNetwork(guestConfig);
             if (!releasedLB) {
                 String msg = "Failed to release the external load balancer used for the network: " + guestConfig.getId();
-                logger.error(msg);
+                s_logger.error(msg);
             }
         }
 
-        if (logger.isDebugEnabled()) {
+        if (s_logger.isDebugEnabled()) {
             Account account = _accountDao.findByIdIncludingRemoved(guestConfig.getAccountId());
             String action = add ? "implemented" : "shut down";
-            logger.debug("External load balancer has " + action + " the guest network for account " + account.getAccountName() + "(id = " + account.getAccountId() +
+            s_logger.debug("External load balancer has " + action + " the guest network for account " + account.getAccountName() + "(id = " + account.getAccountId() +
                 ") with VLAN tag " + guestVlanTag);
         }
 
@@ -1127,20 +1129,20 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
         List<Provider> providers = _networkMgr.getProvidersForServiceInNetwork(network, Service.Firewall);
         //Only support one provider now
         if (providers == null) {
-            logger.error("Cannot find firewall provider for network " + network.getId());
+            s_logger.error("Cannot find firewall provider for network " + network.getId());
             return null;
         }
         if (providers.size() != 1) {
-            logger.error("Found " + providers.size() + " firewall provider for network " + network.getId());
+            s_logger.error("Found " + providers.size() + " firewall provider for network " + network.getId());
             return null;
         }
 
         NetworkElement element = _networkModel.getElementImplementingProvider(providers.get(0).getName());
         if (!(element instanceof IpDeployer)) {
-            logger.error("The firewall provider for network " + network.getName() + " don't have ability to deploy IP address!");
+            s_logger.error("The firewall provider for network " + network.getName() + " don't have ability to deploy IP address!");
             return null;
         }
-        logger.info("Let " + element.getName() + " handle ip association for " + getName() + " in network " + network.getId());
+        s_logger.info("Let " + element.getName() + " handle ip association for " + getName() + " in network " + network.getId());
         return (IpDeployer)element;
     }
 
@@ -1157,7 +1159,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
 
         ExternalLoadBalancerDeviceVO lbDeviceVO = getExternalLoadBalancerForNetwork(network);
         if (lbDeviceVO == null) {
-            logger.warn("There is no external load balancer device assigned to this network either network is not implement are already shutdown so just returning");
+            s_logger.warn("There is no external load balancer device assigned to this network either network is not implement are already shutdown so just returning");
             return null;
         }
 
@@ -1166,7 +1168,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
         boolean externalLoadBalancerIsInline = _networkMgr.isNetworkInlineMode(network);
 
         if (network.getState() == Network.State.Allocated) {
-            logger.debug("External load balancer was asked to apply LB rules for network with ID " + network.getId() +
+            s_logger.debug("External load balancer was asked to apply LB rules for network with ID " + network.getId() +
                 "; this network is not implemented. Skipping backend commands.");
             return null;
         }
@@ -1221,7 +1223,7 @@ public abstract class ExternalLoadBalancerDeviceManagerImpl extends AdapterBase
                 return answer == null ? null : answer.getLoadBalancers();
             }
         } catch (Exception ex) {
-            logger.error("Exception Occured ", ex);
+            s_logger.error("Exception Occured ", ex);
         }
         //null return is handled by clients
         return null;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/8bc02940/server/src/com/cloud/network/ExternalNetworkDeviceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/ExternalNetworkDeviceManagerImpl.java b/server/src/com/cloud/network/ExternalNetworkDeviceManagerImpl.java
index 99e3e27..bf9327f 100644
--- a/server/src/com/cloud/network/ExternalNetworkDeviceManagerImpl.java
+++ b/server/src/com/cloud/network/ExternalNetworkDeviceManagerImpl.java
@@ -26,6 +26,7 @@ import java.util.concurrent.ScheduledExecutorService;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
+import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.api.ApiConstants;
@@ -122,6 +123,7 @@ public class ExternalNetworkDeviceManagerImpl extends ManagerBase implements Ext
     // obsolete
     // private final static IdentityService _identityService = (IdentityService)ComponentLocator.getLocator(ManagementServer.Name).getManager(IdentityService.class);
 
+    private static final org.apache.log4j.Logger s_logger = Logger.getLogger(ExternalNetworkDeviceManagerImpl.class);
 
     @Override
     public Host addNetworkDevice(AddNetworkDeviceCmd cmd) {
@@ -147,7 +149,7 @@ public class ExternalNetworkDeviceManagerImpl extends ManagerBase implements Ext
 //            if (devs.size() == 1) {
 //                res.add(devs.get(0));
 //            } else {
-//                logger.debug("List " + type + ": " + devs.size() + " found");
+//                s_logger.debug("List " + type + ": " + devs.size() + " found");
 //            }
 //        } else {
 //            List<HostVO> devs = _hostDao.listBy(type, zoneId);


Mime
View raw message