cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [20/36] git commit: updated refs/heads/master to cd7218e
Date Sat, 29 Aug 2015 20:06:17 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
index 9024abb..e9f066d 100644
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java
@@ -30,7 +30,6 @@ import javax.persistence.EntityExistsException;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.framework.messagebus.MessageBus;
 import org.apache.cloudstack.framework.messagebus.MessageSubscriber;
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.agent.AgentManager;
@@ -94,7 +93,6 @@ import com.cloud.vm.dao.VMInstanceDao;
 @Component
 @Local(value = {OvsTunnelManager.class})
 public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManager, StateListener<VirtualMachine.State, VirtualMachine.Event, VirtualMachine> {
-    public static final Logger s_logger = Logger.getLogger(OvsTunnelManagerImpl.class.getName());
 
     // boolean _isEnabled;
     ScheduledExecutorService _executorPool;
@@ -161,13 +159,13 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
             OvsTunnelInterfaceVO lock = _tunnelInterfaceDao
                     .acquireInLockTable(Long.valueOf(1));
             if (lock == null) {
-                s_logger.warn("Cannot lock table ovs_tunnel_account");
+                logger.warn("Cannot lock table ovs_tunnel_account");
                 return null;
             }
             _tunnelInterfaceDao.persist(ti);
             _tunnelInterfaceDao.releaseFromLockTable(lock.getId());
         } catch (EntityExistsException e) {
-            s_logger.debug("A record for the interface for network " + label
+            logger.debug("A record for the interface for network " + label
                     + " on host id " + hostId + " already exists");
         }
         return ti;
@@ -183,7 +181,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
             }
         }
         // Fetch interface failed!
-        s_logger.warn("Unable to fetch the IP address for the GRE tunnel endpoint"
+        logger.warn("Unable to fetch the IP address for the GRE tunnel endpoint"
                 + ans.getDetails());
         return null;
     }
@@ -195,13 +193,13 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
             ta = new OvsTunnelNetworkVO(from, to, key, networkId);
             OvsTunnelNetworkVO lock = _tunnelNetworkDao.acquireInLockTable(Long.valueOf(1));
             if (lock == null) {
-                s_logger.warn("Cannot lock table ovs_tunnel_account");
+                logger.warn("Cannot lock table ovs_tunnel_account");
                 return null;
             }
             _tunnelNetworkDao.persist(ta);
             _tunnelNetworkDao.releaseFromLockTable(lock.getId());
         } catch (EntityExistsException e) {
-            s_logger.debug("A record for the tunnel from " + from + " to " + to + " already exists");
+            logger.debug("A record for the tunnel from " + from + " to " + to + " already exists");
         }
         return ta;
     }
@@ -223,12 +221,12 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
         }
         if (!r.getResult()) {
             tunnel.setState(OvsTunnel.State.Failed.name());
-            s_logger.warn("Create GRE tunnel from " + from + " to " + to + " failed due to " + r.getDetails()
+            logger.warn("Create GRE tunnel from " + from + " to " + to + " failed due to " + r.getDetails()
                     + s);
         } else {
             tunnel.setState(OvsTunnel.State.Established.name());
             tunnel.setPortName(r.getInPortName());
-            s_logger.info("Create GRE tunnel from " + from + " to " + to + " succeeded." + r.getDetails() + s);
+            logger.info("Create GRE tunnel from " + from + " to " + to + " succeeded." + r.getDetails() + s);
         }
         _tunnelNetworkDao.update(tunnel.getId(), tunnel);
     }
@@ -273,7 +271,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
             //for network with label on target host
             Commands fetchIfaceCmds =
                     new Commands(new OvsFetchInterfaceCommand(physNetLabel));
-            s_logger.debug("Ask host " + host.getId() +
+            logger.debug("Ask host " + host.getId() +
                     " to retrieve interface for phy net with label:" +
                     physNetLabel);
             Answer[] fetchIfaceAnswers = _agentMgr.send(host.getId(), fetchIfaceCmds);
@@ -299,7 +297,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
 
             return key;
         } catch (NumberFormatException e) {
-            s_logger.debug("Well well, how did '" + key
+            logger.debug("Well well, how did '" + key
                     + "' end up in the broadcast URI for the network?");
             throw new CloudRuntimeException(String.format(
                     "Invalid GRE key parsed from"
@@ -311,7 +309,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
     @DB
     protected void checkAndCreateTunnel(Network nw, Host host) {
 
-        s_logger.debug("Creating tunnels with OVS tunnel manager");
+        logger.debug("Creating tunnels with OVS tunnel manager");
 
         long hostId = host.getId();
         int key = getGreKey(nw);
@@ -326,7 +324,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
             OvsTunnelNetworkVO ta = _tunnelNetworkDao.getByFromToNetwork(hostId, rh.longValue(), nw.getId());
             // Try and create the tunnel even if a previous attempt failed
             if (ta == null || ta.getState().equals(OvsTunnel.State.Failed.name())) {
-                s_logger.debug("Attempting to create tunnel from:" + hostId + " to:" + rh.longValue());
+                logger.debug("Attempting to create tunnel from:" + hostId + " to:" + rh.longValue());
                 if (ta == null) {
                     createTunnelRecord(hostId, rh.longValue(), nw.getId(), key);
                 }
@@ -339,7 +337,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                     hostId, nw.getId());
             // Try and create the tunnel even if a previous attempt failed
             if (ta == null || ta.getState().equals(OvsTunnel.State.Failed.name())) {
-                s_logger.debug("Attempting to create tunnel from:" +
+                logger.debug("Attempting to create tunnel from:" +
                         rh.longValue() + " to:" + hostId);
                 if (ta == null) {
                     createTunnelRecord(rh.longValue(), hostId,
@@ -367,8 +365,8 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                 Commands cmds = new Commands(
                         new OvsCreateTunnelCommand(otherIp, key,
                                 Long.valueOf(hostId), i, nw.getId(), myIp, bridgeName, nw.getUuid()));
-                s_logger.debug("Attempting to create tunnel from:" + hostId + " to:" + i + " for the network " + nw.getId());
-                s_logger.debug("Ask host " + hostId
+                logger.debug("Attempting to create tunnel from:" + hostId + " to:" + i + " for the network " + nw.getId());
+                logger.debug("Ask host " + hostId
                         + " to create gre tunnel to " + i);
                 Answer[] answers = _agentMgr.send(hostId, cmds);
                 handleCreateTunnelAnswer(answers);
@@ -380,7 +378,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                 String otherIp = getGreEndpointIP(rHost, nw);
                 Commands cmds = new Commands(new OvsCreateTunnelCommand(myIp,
                         key, i, Long.valueOf(hostId), nw.getId(), otherIp, bridgeName, nw.getUuid()));
-                s_logger.debug("Ask host " + i + " to create gre tunnel to "
+                logger.debug("Ask host " + i + " to create gre tunnel to "
                         + hostId);
                 Answer[] answers = _agentMgr.send(i, cmds);
                 handleCreateTunnelAnswer(answers);
@@ -391,13 +389,13 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
             // anyway. This will ensure VIF rules will be triggered
             if (noHost) {
                 Commands cmds = new Commands(new OvsSetupBridgeCommand(bridgeName, hostId, nw.getId()));
-                s_logger.debug("Ask host " + hostId + " to configure bridge for network:" + nw.getId());
+                logger.debug("Ask host " + hostId + " to configure bridge for network:" + nw.getId());
                 Answer[] answers = _agentMgr.send(hostId, cmds);
                 handleSetupBridgeAnswer(answers);
             }
         } catch (GreTunnelException | OperationTimedoutException | AgentUnavailableException e) {
             // I really thing we should do a better handling of these exceptions
-            s_logger.warn("Ovs Tunnel network created tunnel failed", e);
+            logger.warn("Ovs Tunnel network created tunnel failed", e);
         }
     }
 
@@ -427,7 +425,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
         if (ans.getResult()) {
             OvsTunnelNetworkVO lock = _tunnelNetworkDao.acquireInLockTable(Long.valueOf(1));
             if (lock == null) {
-                s_logger.warn(String.format("failed to lock" +
+                logger.warn(String.format("failed to lock" +
                         "ovs_tunnel_account, remove record of " +
                         "tunnel(from=%1$s, to=%2$s account=%3$s) failed",
                         from, to, networkId));
@@ -437,11 +435,11 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
             _tunnelNetworkDao.removeByFromToNetwork(from, to, networkId);
             _tunnelNetworkDao.releaseFromLockTable(lock.getId());
 
-            s_logger.debug(String.format("Destroy tunnel(account:%1$s," +
+            logger.debug(String.format("Destroy tunnel(account:%1$s," +
                     "from:%2$s, to:%3$s) successful",
                     networkId, from, to));
         } else {
-            s_logger.debug(String.format("Destroy tunnel(account:%1$s," + "from:%2$s, to:%3$s) failed", networkId, from, to));
+            logger.debug(String.format("Destroy tunnel(account:%1$s," + "from:%2$s, to:%3$s) failed", networkId, from, to));
         }
     }
 
@@ -451,24 +449,24 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
         if (ans.getResult()) {
             OvsTunnelNetworkVO lock = _tunnelNetworkDao.acquireInLockTable(Long.valueOf(1));
             if (lock == null) {
-                s_logger.warn("failed to lock ovs_tunnel_network," + "remove record");
+                logger.warn("failed to lock ovs_tunnel_network," + "remove record");
                 return;
             }
 
             _tunnelNetworkDao.removeByFromNetwork(hostId, networkId);
             _tunnelNetworkDao.releaseFromLockTable(lock.getId());
 
-            s_logger.debug(String.format("Destroy bridge for" +
+            logger.debug(String.format("Destroy bridge for" +
                     "network %1$s successful", networkId));
         } else {
-            s_logger.debug(String.format("Destroy bridge for" +
+            logger.debug(String.format("Destroy bridge for" +
                     "network %1$s failed", networkId));
         }
     }
 
     private void handleSetupBridgeAnswer(Answer[] answers) {
         //TODO: Add some error management here?
-        s_logger.debug("Placeholder for something more meanginful to come");
+        logger.debug("Placeholder for something more meanginful to come");
     }
 
     @Override
@@ -495,7 +493,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                         if (p.getState().equals(OvsTunnel.State.Established.name())) {
                             Command cmd= new OvsDestroyTunnelCommand(p.getNetworkId(), bridgeName,
                                     p.getPortName());
-                            s_logger.debug("Destroying tunnel to " + host.getId() +
+                            logger.debug("Destroying tunnel to " + host.getId() +
                                     " from " + p.getFrom());
                             Answer ans = _agentMgr.send(p.getFrom(), cmd);
                             handleDestroyTunnelAnswer(ans, p.getFrom(), p.getTo(), p.getNetworkId());
@@ -505,11 +503,11 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
 
                 Command cmd = new OvsDestroyBridgeCommand(nw.getId(), generateBridgeNameForVpc(nw.getVpcId()),
                         host.getId());
-                s_logger.debug("Destroying bridge for network " + nw.getId() + " on host:" + host.getId());
+                logger.debug("Destroying bridge for network " + nw.getId() + " on host:" + host.getId());
                 Answer ans = _agentMgr.send(host.getId(), cmd);
                 handleDestroyBridgeAnswer(ans, host.getId(), nw.getId());
             } catch (Exception e) {
-                s_logger.info("[ignored]"
+                logger.info("[ignored]"
                         + "exception while removing host from networks: " + e.getLocalizedMessage());
             }
         } else {
@@ -523,7 +521,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                 int key = getGreKey(nw);
                 String bridgeName = generateBridgeName(nw, key);
                 Command cmd = new OvsDestroyBridgeCommand(nw.getId(), bridgeName, host.getId());
-                s_logger.debug("Destroying bridge for network " + nw.getId() + " on host:" + host.getId());
+                logger.debug("Destroying bridge for network " + nw.getId() + " on host:" + host.getId());
                 Answer ans = _agentMgr.send(host.getId(), cmd);
                 handleDestroyBridgeAnswer(ans, host.getId(), nw.getId());
 
@@ -536,7 +534,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                     if (p.getState().equals(OvsTunnel.State.Established.name())) {
                         cmd = new OvsDestroyTunnelCommand(p.getNetworkId(), bridgeName,
                                 p.getPortName());
-                        s_logger.debug("Destroying tunnel to " + host.getId() +
+                        logger.debug("Destroying tunnel to " + host.getId() +
                                 " from " + p.getFrom());
                         ans = _agentMgr.send(p.getFrom(), cmd);
                         handleDestroyTunnelAnswer(ans, p.getFrom(),
@@ -544,7 +542,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                     }
                 }
             } catch (Exception e) {
-                s_logger.warn("Destroy tunnel failed", e);
+                logger.warn("Destroy tunnel failed", e);
             }
         }
     }
@@ -573,12 +571,12 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
             // since this is the first VM from the VPC being launched on the host, first setup the bridge
             try {
                 Commands cmds = new Commands(new OvsSetupBridgeCommand(bridgeName, hostId, null));
-                s_logger.debug("Ask host " + hostId + " to create bridge for vpc " + vpcId + " and configure the "
+                logger.debug("Ask host " + hostId + " to create bridge for vpc " + vpcId + " and configure the "
                         + " bridge for distributed routing.");
                 Answer[] answers = _agentMgr.send(hostId, cmds);
                 handleSetupBridgeAnswer(answers);
             } catch (OperationTimedoutException | AgentUnavailableException e) {
-                s_logger.warn("Ovs Tunnel network created tunnel failed", e);
+                logger.warn("Ovs Tunnel network created tunnel failed", e);
             }
 
             // now that bridge is setup, populate network acl's before the VM gets created
@@ -586,7 +584,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
             cmd.setSequenceNumber(getNextRoutingPolicyUpdateSequenceNumber(vpcId));
 
             if (!sendVpcRoutingPolicyChangeUpdate(cmd, hostId, bridgeName)) {
-                s_logger.debug("Failed to send VPC routing policy change update to host : " + hostId +
+                logger.debug("Failed to send VPC routing policy change update to host : " + hostId +
                         ". But moving on with sending the updates to the rest of the hosts.");
             }
         }
@@ -610,7 +608,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                 tunnelRecord = _tunnelNetworkDao.getByFromToNetwork(hostId, rh.longValue(), vpcNetwork.getId());
                 // Try and create the tunnel if does not exit or previous attempt failed
                 if (tunnelRecord == null || tunnelRecord.getState().equals(OvsTunnel.State.Failed.name())) {
-                    s_logger.debug("Attempting to create tunnel from:" + hostId + " to:" + rh.longValue());
+                    logger.debug("Attempting to create tunnel from:" + hostId + " to:" + rh.longValue());
                     if (tunnelRecord == null) {
                         createTunnelRecord(hostId, rh.longValue(), vpcNetwork.getId(), key);
                     }
@@ -621,7 +619,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                 tunnelRecord = _tunnelNetworkDao.getByFromToNetwork(rh.longValue(), hostId, vpcNetwork.getId());
                 // Try and create the tunnel if does not exit or previous attempt failed
                 if (tunnelRecord == null || tunnelRecord.getState().equals(OvsTunnel.State.Failed.name())) {
-                    s_logger.debug("Attempting to create tunnel from:" + rh.longValue() + " to:" + hostId);
+                    logger.debug("Attempting to create tunnel from:" + rh.longValue() + " to:" + hostId);
                     if (tunnelRecord == null) {
                         createTunnelRecord(rh.longValue(), hostId, vpcNetwork.getId(), key);
                     }
@@ -647,9 +645,9 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                                         + "Failure is on host:" + rHost.getId());
                     Commands cmds = new Commands( new OvsCreateTunnelCommand(otherIp, key, Long.valueOf(hostId),
                                      i, vpcNetwork.getId(), myIp, bridgeName, vpcNetwork.getUuid()));
-                    s_logger.debug("Attempting to create tunnel from:" + hostId + " to:" + i + " for the network "
+                    logger.debug("Attempting to create tunnel from:" + hostId + " to:" + i + " for the network "
                             + vpcNetwork.getId());
-                    s_logger.debug("Ask host " + hostId
+                    logger.debug("Ask host " + hostId
                             + " to create gre tunnel to " + i);
                     Answer[] answers = _agentMgr.send(hostId, cmds);
                     handleCreateTunnelAnswer(answers);
@@ -661,14 +659,14 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                     Commands cmds = new Commands(new OvsCreateTunnelCommand(myIp,
                             key, i, Long.valueOf(hostId), vpcNetwork.getId(), otherIp, bridgeName,
                             vpcNetwork.getUuid()));
-                    s_logger.debug("Ask host " + i + " to create gre tunnel to "
+                    logger.debug("Ask host " + i + " to create gre tunnel to "
                             + hostId);
                     Answer[] answers = _agentMgr.send(i, cmds);
                     handleCreateTunnelAnswer(answers);
                 }
             } catch (GreTunnelException | OperationTimedoutException | AgentUnavailableException e) {
                 // I really thing we should do a better handling of these exceptions
-                s_logger.warn("Ovs Tunnel network created tunnel failed", e);
+                logger.warn("Ovs Tunnel network created tunnel failed", e);
             }
         }
     }
@@ -725,7 +723,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
             // send topology change update to VPC spanned hosts
             for (Long id: vpcSpannedHostIds) {
                 if (!sendVpcTopologyChangeUpdate(topologyConfigCommand, id, bridgeName)) {
-                    s_logger.debug("Failed to send VPC topology change update to host : " + id + ". Moving on " +
+                    logger.debug("Failed to send VPC topology change update to host : " + id + ". Moving on " +
                             "with rest of the host update.");
                 }
             }
@@ -734,19 +732,19 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
 
     public boolean sendVpcTopologyChangeUpdate(OvsVpcPhysicalTopologyConfigCommand updateCmd, long hostId, String bridgeName) {
         try {
-            s_logger.debug("Sending VPC topology change update to the host " + hostId);
+            logger.debug("Sending VPC topology change update to the host " + hostId);
             updateCmd.setHostId(hostId);
             updateCmd.setBridgeName(bridgeName);
             Answer ans = _agentMgr.send(hostId, updateCmd);
             if (ans.getResult()) {
-                s_logger.debug("Successfully updated the host " + hostId + " with latest VPC topology." );
+                logger.debug("Successfully updated the host " + hostId + " with latest VPC topology." );
                 return true;
             }  else {
-                s_logger.debug("Failed to update the host " + hostId + " with latest VPC topology." );
+                logger.debug("Failed to update the host " + hostId + " with latest VPC topology." );
                 return false;
             }
         } catch (Exception e) {
-            s_logger.debug("Failed to updated the host " + hostId + " with latest VPC topology.", e );
+            logger.debug("Failed to updated the host " + hostId + " with latest VPC topology.", e );
             return false;
         }
     }
@@ -770,7 +768,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                 try {
                     remoteIp = getGreEndpointIP(hostDetails, network);
                 } catch (Exception e) {
-                    s_logger.info("[ignored]"
+                    logger.info("[ignored]"
                             + "error getting GRE endpoint: " + e.getLocalizedMessage());
                 }
             }
@@ -838,13 +836,13 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
                     List<Long> vpcSpannedHostIds = _ovsNetworkToplogyGuru.getVpcSpannedHosts(vpcId);
                     for (Long id: vpcSpannedHostIds) {
                         if (!sendVpcRoutingPolicyChangeUpdate(cmd, id, bridgeName)) {
-                            s_logger.debug("Failed to send VPC routing policy change update to host : " + id +
+                            logger.debug("Failed to send VPC routing policy change update to host : " + id +
                                     ". But moving on with sending the updates to the rest of the hosts.");
                         }
                     }
                 }
             } catch (Exception e) {
-                s_logger.debug("Failed to send VPC routing policy change updates all hosts in vpc", e);
+                logger.debug("Failed to send VPC routing policy change updates all hosts in vpc", e);
             }
         }
     }
@@ -895,19 +893,19 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
 
     private boolean sendVpcRoutingPolicyChangeUpdate(OvsVpcRoutingPolicyConfigCommand updateCmd, long hostId, String bridgeName) {
         try {
-            s_logger.debug("Sending VPC routing policies change update to the host " + hostId);
+            logger.debug("Sending VPC routing policies change update to the host " + hostId);
             updateCmd.setHostId(hostId);
             updateCmd.setBridgeName(bridgeName);
             Answer ans = _agentMgr.send(hostId, updateCmd);
             if (ans.getResult()) {
-                s_logger.debug("Successfully updated the host " + hostId + " with latest VPC routing policies." );
+                logger.debug("Successfully updated the host " + hostId + " with latest VPC routing policies." );
                 return true;
             }  else {
-                s_logger.debug("Failed to update the host " + hostId + " with latest routing policies." );
+                logger.debug("Failed to update the host " + hostId + " with latest routing policies." );
                 return false;
             }
         } catch (Exception e) {
-            s_logger.debug("Failed to updated the host " + hostId + " with latest routing policies due to" , e );
+            logger.debug("Failed to updated the host " + hostId + " with latest routing policies due to" , e );
             return false;
         }
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/VpcDistributedRouterSeqNoDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/VpcDistributedRouterSeqNoDaoImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/VpcDistributedRouterSeqNoDaoImpl.java
index 88fa9c1..cdd031e 100644
--- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/VpcDistributedRouterSeqNoDaoImpl.java
+++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/VpcDistributedRouterSeqNoDaoImpl.java
@@ -18,7 +18,6 @@ package com.cloud.network.ovs.dao;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.GenericDaoBase;
@@ -28,7 +27,6 @@ import com.cloud.utils.db.SearchCriteria;
 @Component
 @Local(value = {VpcDistributedRouterSeqNoDao.class})
 public class VpcDistributedRouterSeqNoDaoImpl extends GenericDaoBase<VpcDistributedRouterSeqNoVO, Long> implements VpcDistributedRouterSeqNoDao {
-    protected static final Logger s_logger = Logger.getLogger(VpcDistributedRouterSeqNoDaoImpl.class);
     private SearchBuilder<VpcDistributedRouterSeqNoVO> VpcIdSearch;
 
     protected VpcDistributedRouterSeqNoDaoImpl() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoExternalFirewallElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoExternalFirewallElement.java b/plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoExternalFirewallElement.java
index cfb64b8..1ed94b08 100644
--- a/plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoExternalFirewallElement.java
+++ b/plugins/network-elements/palo-alto/src/com/cloud/network/element/PaloAltoExternalFirewallElement.java
@@ -25,7 +25,6 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.network.ExternalNetworkDeviceManager.NetworkDevice;
@@ -87,7 +86,6 @@ import com.cloud.vm.VirtualMachineProfile;
 public class PaloAltoExternalFirewallElement extends ExternalFirewallDeviceManagerImpl implements SourceNatServiceProvider, FirewallServiceProvider,
         PortForwardingServiceProvider, IpDeployer, PaloAltoFirewallElementService, StaticNatServiceProvider {
 
-    private static final Logger s_logger = Logger.getLogger(PaloAltoExternalFirewallElement.class);
 
     private static final Map<Service, Map<Capability, String>> capabilities = setCapabilities();
 
@@ -123,18 +121,18 @@ public class PaloAltoExternalFirewallElement extends ExternalFirewallDeviceManag
     private boolean canHandle(Network network, Service service) {
         DataCenter zone = _entityMgr.findById(DataCenter.class, network.getDataCenterId());
         if (zone.getNetworkType() == NetworkType.Advanced && network.getGuestType() != Network.GuestType.Isolated) {
-            s_logger.trace("Element " + getProvider().getName() + "is not handling network type = " + network.getGuestType());
+            logger.trace("Element " + getProvider().getName() + "is not handling network type = " + network.getGuestType());
             return false;
         }
 
         if (service == null) {
             if (!_networkManager.isProviderForNetwork(getProvider(), network.getId())) {
-                s_logger.trace("Element " + getProvider().getName() + " is not a provider for the network " + network);
+                logger.trace("Element " + getProvider().getName() + " is not a provider for the network " + network);
                 return false;
             }
         } else {
             if (!_networkManager.isProviderSupportServiceInNetwork(network.getId(), service, getProvider())) {
-                s_logger.trace("Element " + getProvider().getName() + " doesn't support service " + service.getName() + " in the network " + network);
+                logger.trace("Element " + getProvider().getName() + " doesn't support service " + service.getName() + " in the network " + network);
                 return false;
             }
         }
@@ -149,7 +147,7 @@ public class PaloAltoExternalFirewallElement extends ExternalFirewallDeviceManag
 
         // don't have to implement network is Basic zone
         if (zone.getNetworkType() == NetworkType.Basic) {
-            s_logger.debug("Not handling network implement in zone of type " + NetworkType.Basic);
+            logger.debug("Not handling network implement in zone of type " + NetworkType.Basic);
             return false;
         }
 
@@ -162,7 +160,7 @@ public class PaloAltoExternalFirewallElement extends ExternalFirewallDeviceManag
         } catch (InsufficientCapacityException capacityException) {
             // TODO: handle out of capacity exception in more gracefule manner when multiple providers are present for
             // the network
-            s_logger.error("Fail to implement the Palo Alto for network " + network, capacityException);
+            logger.error("Fail to implement the Palo Alto for network " + network, capacityException);
             return false;
         }
     }
@@ -184,7 +182,7 @@ public class PaloAltoExternalFirewallElement extends ExternalFirewallDeviceManag
 
         // don't have to implement network is Basic zone
         if (zone.getNetworkType() == NetworkType.Basic) {
-            s_logger.debug("Not handling network shutdown in zone of type " + NetworkType.Basic);
+            logger.debug("Not handling network shutdown in zone of type " + NetworkType.Basic);
             return false;
         }
 
@@ -432,7 +430,7 @@ public class PaloAltoExternalFirewallElement extends ExternalFirewallDeviceManag
     @Override
     public boolean verifyServicesCombination(Set<Service> services) {
         if (!services.contains(Service.Firewall)) {
-            s_logger.warn("Palo Alto must be used as Firewall Service Provider in the network");
+            logger.warn("Palo Alto must be used as Firewall Service Provider in the network");
             return false;
         }
         return true;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/dao/SspUuidDaoImpl.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/dao/SspUuidDaoImpl.java b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/dao/SspUuidDaoImpl.java
index d088e7f..2d6fe71 100644
--- a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/dao/SspUuidDaoImpl.java
+++ b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/dao/SspUuidDaoImpl.java
@@ -20,7 +20,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 
 import com.cloud.network.Network;
 import com.cloud.utils.db.GenericDaoBase;
@@ -32,7 +31,6 @@ import com.cloud.vm.NicProfile;
 @Local(SspUuidDao.class)
 public class SspUuidDaoImpl extends GenericDaoBase<SspUuidVO, Long> implements SspUuidDao {
 
-    private static final Logger s_logger = Logger.getLogger(SspUuidDaoImpl.class);
 
     protected final SearchBuilder<SspUuidVO> native2uuid;
     protected final SearchBuilder<SspUuidVO> uuid2native;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/element/SspElement.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/element/SspElement.java b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/element/SspElement.java
index b41be40..f8f303c 100644
--- a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/element/SspElement.java
+++ b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/element/SspElement.java
@@ -30,7 +30,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.api.commands.AddSspCmd;
 import org.apache.cloudstack.api.commands.DeleteSspCmd;
@@ -90,7 +89,6 @@ import com.cloud.vm.dao.NicDao;
  */
 @Local(value = {NetworkElement.class, SspManager.class})
 public class SspElement extends AdapterBase implements ConnectivityProvider, SspManager, SspService, NetworkMigrationResponder {
-    private static final Logger s_logger = Logger.getLogger(SspElement.class);
     public static final String s_SSP_NAME = "StratosphereSsp";
     private static final Provider s_ssp_provider = new Provider(s_SSP_NAME, false);
 
@@ -183,7 +181,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
         if (fetchSspClients(physicalNetwork.getId(), physicalNetwork.getDataCenterId(), false).size() > 0) {
             return true;
         }
-        s_logger.warn("Ssp api endpoint not found. " + physicalNetwork.toString());
+        logger.warn("Ssp api endpoint not found. " + physicalNetwork.toString());
         return false;
     }
 
@@ -197,9 +195,9 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
             if (fetchSspClients(physicalNetwork.getId(), physicalNetwork.getDataCenterId(), true).size() > 0) {
                 return true;
             }
-            s_logger.warn("enabled Ssp api endpoint not found. " + physicalNetwork.toString());
+            logger.warn("enabled Ssp api endpoint not found. " + physicalNetwork.toString());
         } else {
-            s_logger.warn("PhysicalNetwork is NULL.");
+            logger.warn("PhysicalNetwork is NULL.");
         }
         return false;
     }
@@ -207,7 +205,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
     private boolean canHandle(Network network) {
         if (canHandle(_physicalNetworkDao.findById(network.getPhysicalNetworkId()))) {
             if (!_ntwkSrvcDao.canProviderSupportServiceInNetwork(network.getId(), Service.Connectivity, getProvider())) {
-                s_logger.info("SSP is implicitly active for " + network);
+                logger.info("SSP is implicitly active for " + network);
             }
             return true;
         }
@@ -234,7 +232,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
             _sspCredentialDao.persist(credential);
         } else {
             if (cmd.getUsername() != null || cmd.getPassword() != null) {
-                s_logger.warn("Tenant credential already configured for zone:" + zoneId);
+                logger.warn("Tenant credential already configured for zone:" + zoneId);
             }
         }
 
@@ -249,7 +247,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
             _sspTenantDao.persist(tenant);
         } else {
             if (cmd.getTenantUuid() != null) {
-                s_logger.warn("Tenant uuid already configured for zone:" + zoneId);
+                logger.warn("Tenant uuid already configured for zone:" + zoneId);
             }
         }
 
@@ -269,7 +267,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
             _hostDao.loadDetails(host);
             if ("v1Api".equals(host.getDetail("sspHost"))) {
                 if (normalizedUrl.equals(host.getDetail("url"))) {
-                    s_logger.warn("Ssp host already registered " + normalizedUrl);
+                    logger.warn("Ssp host already registered " + normalizedUrl);
                     return host;
                 }
             }
@@ -292,14 +290,14 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
 
     @Override
     public boolean deleteSspHost(DeleteSspCmd cmd) {
-        s_logger.info("deleteStratosphereSsp");
+        logger.info("deleteStratosphereSsp");
         return _hostDao.remove(cmd.getHostId());
     }
 
     @Override
     public boolean createNetwork(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context) {
         if (_sspUuidDao.findUuidByNetwork(network) != null) {
-            s_logger.info("Network already has ssp TenantNetwork uuid :" + network.toString());
+            logger.info("Network already has ssp TenantNetwork uuid :" + network.toString());
             return true;
         }
         if (!canHandle(network)) {
@@ -325,10 +323,10 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
             processed = true;
         }
         if (processed) {
-            s_logger.error("Could not allocate an uuid for network " + network.toString());
+            logger.error("Could not allocate an uuid for network " + network.toString());
             return false;
         } else {
-            s_logger.error("Skipping #createNetwork() for " + network.toString());
+            logger.error("Skipping #createNetwork() for " + network.toString());
             return true;
         }
     }
@@ -346,10 +344,10 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
                 }
             }
             if (!processed) {
-                s_logger.error("Ssp api tenant network deletion failed " + network.toString());
+                logger.error("Ssp api tenant network deletion failed " + network.toString());
             }
         } else {
-            s_logger.debug("Silently skipping #deleteNetwork() for " + network.toString());
+            logger.debug("Silently skipping #deleteNetwork() for " + network.toString());
         }
         return true;
     }
@@ -359,7 +357,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
     public boolean createNicEnv(Network network, NicProfile nic, DeployDestination dest, ReservationContext context) {
         String tenantNetworkUuid = _sspUuidDao.findUuidByNetwork(network);
         if (tenantNetworkUuid == null) {
-            s_logger.debug("Skipping #createNicEnv() for nic on " + network.toString());
+            logger.debug("Skipping #createNicEnv() for nic on " + network.toString());
             return true;
         }
 
@@ -367,7 +365,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
         List<SspUuidVO> tenantPortUuidVos = _sspUuidDao.listUUidVoByNicProfile(nic);
         for (SspUuidVO tenantPortUuidVo : tenantPortUuidVos) {
             if (reservationId.equals(tenantPortUuidVo.getReservationId())) {
-                s_logger.info("Skipping because reservation found " + reservationId);
+                logger.info("Skipping because reservation found " + reservationId);
                 return true;
             }
         }
@@ -389,7 +387,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
             }
         }
         if (tenantPortUuid == null) {
-            s_logger.debug("#createNicEnv() failed for nic on " + network.toString());
+            logger.debug("#createNicEnv() failed for nic on " + network.toString());
             return false;
         }
 
@@ -403,14 +401,14 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
                 return true;
             }
         }
-        s_logger.error("Updating vif failed " + nic.toString());
+        logger.error("Updating vif failed " + nic.toString());
         return false;
     }
 
     @Override
     public boolean deleteNicEnv(Network network, NicProfile nic, ReservationContext context) {
         if (context == null) {
-            s_logger.error("ReservationContext was null for " + nic + " " + network);
+            logger.error("ReservationContext was null for " + nic + " " + network);
             return false;
         }
         String reservationId = context.getReservationId();
@@ -437,7 +435,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
                 }
             }
             if (!processed) {
-                s_logger.warn("Ssp api nic detach failed " + nic.toString());
+                logger.warn("Ssp api nic detach failed " + nic.toString());
             }
             processed = false;
             for (SspClient client : fetchSspClients(network.getPhysicalNetworkId(), network.getDataCenterId(), true)) {
@@ -448,7 +446,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
                 }
             }
             if (!processed) {
-                s_logger.warn("Ssp api tenant port deletion failed " + nic.toString());
+                logger.warn("Ssp api tenant port deletion failed " + nic.toString());
             }
             _sspUuidDao.removeUuid(tenantPortUuid);
         }
@@ -470,7 +468,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
     @Override
     public boolean implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context) throws ConcurrentOperationException,
         ResourceUnavailableException, InsufficientCapacityException {
-        s_logger.info("implement");
+        logger.info("implement");
         return createNetwork(network, offering, dest, context);
     }
 
@@ -483,7 +481,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
      */
     @Override
     public boolean shutdown(Network network, ReservationContext context, boolean cleanup) throws ConcurrentOperationException, ResourceUnavailableException {
-        s_logger.trace("shutdown");
+        logger.trace("shutdown");
         return deleteNetwork(network);
     }
 
@@ -497,7 +495,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
     @Override
     public boolean prepare(Network network, NicProfile nic, VirtualMachineProfile vm, DeployDestination dest, ReservationContext context)
         throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
-        s_logger.trace("prepare");
+        logger.trace("prepare");
         return createNicEnv(network, nic, dest, context);
     }
 
@@ -511,7 +509,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
     @Override
     public boolean release(Network network, NicProfile nic, VirtualMachineProfile vm, ReservationContext context) throws ConcurrentOperationException,
         ResourceUnavailableException {
-        s_logger.trace("release");
+        logger.trace("release");
         return deleteNicEnv(network, nic, context);
     }
 
@@ -523,7 +521,7 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
      */
     @Override
     public boolean destroy(Network network, ReservationContext context) throws ConcurrentOperationException, ResourceUnavailableException {
-        s_logger.trace("destroy");
+        logger.trace("destroy");
         // nothing to do here.
         return true;
     }
@@ -531,19 +529,19 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
     @Override
     public boolean shutdownProviderInstances(PhysicalNetworkServiceProvider provider, ReservationContext context) throws ConcurrentOperationException,
         ResourceUnavailableException {
-        s_logger.trace("shutdownProviderInstances");
+        logger.trace("shutdownProviderInstances");
         return true;
     }
 
     @Override
     public boolean canEnableIndividualServices() {
-        s_logger.trace("canEnableIndividualServices");
+        logger.trace("canEnableIndividualServices");
         return true; // because there is only Connectivity
     }
 
     @Override
     public boolean verifyServicesCombination(Set<Service> services) {
-        s_logger.trace("verifyServicesCombination " + services.toString());
+        logger.trace("verifyServicesCombination " + services.toString());
         return true;
     }
 
@@ -552,13 +550,13 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
         try {
             prepare(network, nic, vm, dest, context);
         } catch (ConcurrentOperationException e) {
-            s_logger.error("prepareForMigration failed.", e);
+            logger.error("prepareForMigration failed.", e);
             return false;
         } catch (ResourceUnavailableException e) {
-            s_logger.error("prepareForMigration failed.", e);
+            logger.error("prepareForMigration failed.", e);
             return false;
         } catch (InsufficientCapacityException e) {
-            s_logger.error("prepareForMigration failed.", e);
+            logger.error("prepareForMigration failed.", e);
             return false;
         }
         return true;
@@ -569,9 +567,9 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
         try {
             release(network, nic, vm, dst);
         } catch (ConcurrentOperationException e) {
-            s_logger.error("rollbackMigration failed.", e);
+            logger.error("rollbackMigration failed.", e);
         } catch (ResourceUnavailableException e) {
-            s_logger.error("rollbackMigration failed.", e);
+            logger.error("rollbackMigration failed.", e);
         }
     }
 
@@ -580,9 +578,9 @@ public class SspElement extends AdapterBase implements ConnectivityProvider, Ssp
         try {
             release(network, nic, vm, src);
         } catch (ConcurrentOperationException e) {
-            s_logger.error("commitMigration failed.", e);
+            logger.error("commitMigration failed.", e);
         } catch (ResourceUnavailableException e) {
-            s_logger.error("commitMigration failed.", e);
+            logger.error("commitMigration failed.", e);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/guru/SspGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/guru/SspGuestNetworkGuru.java b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/guru/SspGuestNetworkGuru.java
index 7226873..3e0af50 100644
--- a/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/guru/SspGuestNetworkGuru.java
+++ b/plugins/network-elements/stratosphere-ssp/src/org/apache/cloudstack/network/guru/SspGuestNetworkGuru.java
@@ -19,7 +19,6 @@ package org.apache.cloudstack.network.guru;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.network.element.SspElement;
 import org.apache.cloudstack.network.element.SspManager;
@@ -48,7 +47,6 @@ import com.cloud.vm.VirtualMachineProfile;
  */
 @Local(value = NetworkGuru.class)
 public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigrationResponder {
-    private static final Logger s_logger = Logger.getLogger(SspGuestNetworkGuru.class);
 
     @Inject
     SspManager _sspMgr;
@@ -64,7 +62,7 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr
 
     @Override
     protected boolean canHandle(NetworkOffering offering, NetworkType networkType, PhysicalNetwork physicalNetwork) {
-        s_logger.trace("canHandle");
+        logger.trace("canHandle");
 
         String setting = null;
         if (physicalNetwork != null && physicalNetwork.getIsolationMethods().contains("SSP")) {
@@ -75,18 +73,18 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr
         }
         if (setting != null) {
             if (networkType != NetworkType.Advanced) {
-                s_logger.info("SSP enebled by " + setting + " but not active because networkType was " + networkType);
+                logger.info("SSP enebled by " + setting + " but not active because networkType was " + networkType);
             } else if (!isMyTrafficType(offering.getTrafficType())) {
-                s_logger.info("SSP enabled by " + setting + " but not active because traffic type not Guest");
+                logger.info("SSP enabled by " + setting + " but not active because traffic type not Guest");
             } else if (offering.getGuestType() != Network.GuestType.Isolated) {
-                s_logger.info("SSP works for network isolatation.");
+                logger.info("SSP works for network isolatation.");
             } else if (!_sspMgr.canHandle(physicalNetwork)) {
-                s_logger.info("SSP manager not ready");
+                logger.info("SSP manager not ready");
             } else {
                 return true;
             }
         } else {
-            s_logger.debug("SSP not configured to be active");
+            logger.debug("SSP not configured to be active");
         }
         return false;
     }
@@ -101,7 +99,7 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr
     @Override
     public Network implement(Network network, NetworkOffering offering, DeployDestination dest, ReservationContext context)
         throws InsufficientVirtualNetworkCapacityException {
-        s_logger.trace("implement " + network.toString());
+        logger.trace("implement " + network.toString());
         super.implement(network, offering, dest, context);
         _sspMgr.createNetwork(network, offering, dest, context);
         return network;
@@ -109,7 +107,7 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr
 
     @Override
     public void shutdown(NetworkProfile profile, NetworkOffering offering) {
-        s_logger.trace("shutdown " + profile.toString());
+        logger.trace("shutdown " + profile.toString());
         _sspMgr.deleteNetwork(profile);
         super.shutdown(profile, offering);
     }
@@ -138,10 +136,10 @@ public class SspGuestNetworkGuru extends GuestNetworkGuru implements NetworkMigr
         try {
             reserve(nic, network, vm, dest, context);
         } catch (InsufficientVirtualNetworkCapacityException e) {
-            s_logger.error("prepareForMigration failed", e);
+            logger.error("prepareForMigration failed", e);
             return false;
         } catch (InsufficientAddressCapacityException e) {
-            s_logger.error("prepareForMigration failed", e);
+            logger.error("prepareForMigration failed", e);
             return false;
         }
         return true;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/network-elements/vxlan/src/com/cloud/network/guru/VxlanGuestNetworkGuru.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/vxlan/src/com/cloud/network/guru/VxlanGuestNetworkGuru.java b/plugins/network-elements/vxlan/src/com/cloud/network/guru/VxlanGuestNetworkGuru.java
index 4138b22..f891543 100644
--- a/plugins/network-elements/vxlan/src/com/cloud/network/guru/VxlanGuestNetworkGuru.java
+++ b/plugins/network-elements/vxlan/src/com/cloud/network/guru/VxlanGuestNetworkGuru.java
@@ -18,7 +18,6 @@ package com.cloud.network.guru;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.context.CallContext;
@@ -49,7 +48,6 @@ import com.cloud.vm.VirtualMachineProfile;
 @Component
 @Local(value = NetworkGuru.class)
 public class VxlanGuestNetworkGuru extends GuestNetworkGuru {
-    private static final Logger s_logger = Logger.getLogger(VxlanGuestNetworkGuru.class);
 
     public VxlanGuestNetworkGuru() {
         super();
@@ -63,7 +61,7 @@ public class VxlanGuestNetworkGuru extends GuestNetworkGuru {
             isMyIsolationMethod(physicalNetwork)) {
             return true;
         } else {
-            s_logger.trace("We only take care of Guest networks of type   " + GuestType.Isolated + " in zone of type " + NetworkType.Advanced);
+            logger.trace("We only take care of Guest networks of type   " + GuestType.Isolated + " in zone of type " + NetworkType.Advanced);
             return false;
         }
     }
@@ -151,7 +149,7 @@ public class VxlanGuestNetworkGuru extends GuestNetworkGuru {
     public void shutdown(NetworkProfile profile, NetworkOffering offering) {
         NetworkVO networkObject = _networkDao.findById(profile.getId());
         if (networkObject.getBroadcastDomainType() != BroadcastDomainType.Vxlan || networkObject.getBroadcastUri() == null) {
-            s_logger.warn("BroadcastUri is empty or incorrect for guestnetwork " + networkObject.getDisplayText());
+            logger.warn("BroadcastUri is empty or incorrect for guestnetwork " + networkObject.getDisplayText());
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
----------------------------------------------------------------------
diff --git a/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java b/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
index 83c23c2..04ee5c0 100644
--- a/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
+++ b/plugins/storage-allocators/random/src/org/apache/cloudstack/storage/allocator/RandomStoragePoolAllocator.java
@@ -21,7 +21,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator;
 import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
@@ -35,7 +34,6 @@ import com.cloud.vm.VirtualMachineProfile;
 
 @Local(value = StoragePoolAllocator.class)
 public class RandomStoragePoolAllocator extends AbstractStoragePoolAllocator {
-    private static final Logger s_logger = Logger.getLogger(RandomStoragePoolAllocator.class);
 
     @Override
     public List<StoragePool> select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) {
@@ -50,18 +48,18 @@ public class RandomStoragePoolAllocator extends AbstractStoragePoolAllocator {
             return null;
         }
 
-        s_logger.debug("Looking for pools in dc: " + dcId + "  pod:" + podId + "  cluster:" + clusterId);
+        logger.debug("Looking for pools in dc: " + dcId + "  pod:" + podId + "  cluster:" + clusterId);
         List<StoragePoolVO> pools = _storagePoolDao.listBy(dcId, podId, clusterId, ScopeType.CLUSTER);
         if (pools.size() == 0) {
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("No storage pools available for allocation, returning");
+            if (logger.isDebugEnabled()) {
+                logger.debug("No storage pools available for allocation, returning");
             }
             return suitablePools;
         }
 
         Collections.shuffle(pools);
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("RandomStoragePoolAllocator has " + pools.size() + " pools to check for allocation");
+        if (logger.isDebugEnabled()) {
+            logger.debug("RandomStoragePoolAllocator has " + pools.size() + " pools to check for allocation");
         }
         for (StoragePoolVO pool : pools) {
             if (suitablePools.size() == returnUpTo) {
@@ -74,8 +72,8 @@ public class RandomStoragePoolAllocator extends AbstractStoragePoolAllocator {
             }
         }
 
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("RandomStoragePoolAllocator returning " + suitablePools.size() + " suitable storage pools");
+        if (logger.isDebugEnabled()) {
+            logger.debug("RandomStoragePoolAllocator returning " + suitablePools.size() + " suitable storage pools");
         }
 
         return suitablePools;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorVolumeApiServiceImpl.java
----------------------------------------------------------------------
diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorVolumeApiServiceImpl.java b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorVolumeApiServiceImpl.java
index 709c1fe..83f7356 100644
--- a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorVolumeApiServiceImpl.java
+++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorVolumeApiServiceImpl.java
@@ -26,7 +26,6 @@ import java.util.Map;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.api.response.ListResponse;
@@ -47,7 +46,6 @@ import com.cloud.vm.dao.UserVmDao;
 
 @Component
 public class ElastistorVolumeApiServiceImpl extends ManagerBase implements ElastistorVolumeApiService {
-    private static final Logger s_logger = Logger.getLogger(ElastistorVolumeApiServiceImpl.class);
 
     @Inject
     protected VolumeDao _volsDao;
@@ -74,7 +72,7 @@ public class ElastistorVolumeApiServiceImpl extends ManagerBase implements Elast
         cmdList.add(ListElastistorPoolCmd.class);
         cmdList.add(ListElastistorInterfaceCmd.class);
 
-        s_logger.info("Commands were registered successfully with elastistor volume api service. [cmdcount:" + cmdList.size() + "]");
+        logger.info("Commands were registered successfully with elastistor volume api service. [cmdcount:" + cmdList.size() + "]");
         return cmdList;
 
     }
@@ -125,7 +123,7 @@ public class ElastistorVolumeApiServiceImpl extends ManagerBase implements Elast
 
             return response;
         } catch (Throwable e) {
-            s_logger.error("Unable to list elastistor volume.", e);
+            logger.error("Unable to list elastistor volume.", e);
             throw new CloudRuntimeException("Unable to list elastistor volume. " + e.getMessage());
         }
     }
@@ -165,7 +163,7 @@ public class ElastistorVolumeApiServiceImpl extends ManagerBase implements Elast
             return response;
 
         } catch (Throwable e) {
-            s_logger.error("Unable to list elastistor pools.", e);
+            logger.error("Unable to list elastistor pools.", e);
             throw new CloudRuntimeException("Unable to list elastistor pools. " + e.getMessage());
         }
 
@@ -199,7 +197,7 @@ public class ElastistorVolumeApiServiceImpl extends ManagerBase implements Elast
 
             return response;
         } catch (Throwable e) {
-            s_logger.error("Unable to list elastistor interfaces.", e);
+            logger.error("Unable to list elastistor interfaces.", e);
             throw new CloudRuntimeException("Unable to list elastistor interfaces. " + e.getMessage());
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java
index 8c6820f..fd7bcd0 100644
--- a/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java
+++ b/plugins/user-authenticators/ldap/src/org/apache/cloudstack/ldap/LdapAuthenticator.java
@@ -21,13 +21,11 @@ import com.cloud.user.UserAccount;
 import com.cloud.user.dao.UserAccountDao;
 import com.cloud.utils.Pair;
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
 
 import javax.inject.Inject;
 import java.util.Map;
 
 public class LdapAuthenticator extends DefaultUserAuthenticator {
-    private static final Logger s_logger = Logger.getLogger(LdapAuthenticator.class.getName());
 
     @Inject
     private LdapManager _ldapManager;
@@ -48,14 +46,14 @@ public class LdapAuthenticator extends DefaultUserAuthenticator {
     public Pair<Boolean, ActionOnFailedAuthentication> authenticate(final String username, final String password, final Long domainId, final Map<String, Object[]> requestParameters) {
 
         if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
-            s_logger.debug("Username or Password cannot be empty");
+            logger.debug("Username or Password cannot be empty");
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
         }
 
         final UserAccount user = _userAccountDao.getUserAccount(username, domainId);
 
         if (user == null) {
-            s_logger.debug("Unable to find user with " + username + " in domain " + domainId);
+            logger.debug("Unable to find user with " + username + " in domain " + domainId);
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
         } else if (_ldapManager.isLdapEnabled()) {
             boolean result = _ldapManager.canAuthenticate(username, password);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java b/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java
index f08ec37..f91146b 100644
--- a/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java
+++ b/plugins/user-authenticators/md5/src/com/cloud/server/auth/MD5UserAuthenticator.java
@@ -20,7 +20,6 @@ import com.cloud.user.dao.UserAccountDao;
 import com.cloud.utils.Pair;
 import com.cloud.utils.exception.CloudRuntimeException;
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
 
 import javax.ejb.Local;
 import javax.inject.Inject;
@@ -36,30 +35,29 @@ import java.util.Map;
  */
 @Local(value = {UserAuthenticator.class})
 public class MD5UserAuthenticator extends DefaultUserAuthenticator {
-    public static final Logger s_logger = Logger.getLogger(MD5UserAuthenticator.class);
 
     @Inject
     private UserAccountDao _userAccountDao;
 
     @Override
     public Pair<Boolean, ActionOnFailedAuthentication> authenticate(String username, String password, Long domainId, Map<String, Object[]> requestParameters) {
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Retrieving user: " + username);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Retrieving user: " + username);
         }
 
         if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
-            s_logger.debug("Username or Password cannot be empty");
+            logger.debug("Username or Password cannot be empty");
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
         }
 
         UserAccount user = _userAccountDao.getUserAccount(username, domainId);
         if (user == null) {
-            s_logger.debug("Unable to find user with " + username + " in domain " + domainId);
+            logger.debug("Unable to find user with " + username + " in domain " + domainId);
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
         }
 
         if (!user.getPassword().equals(encode(password))) {
-            s_logger.debug("Password does not match");
+            logger.debug("Password does not match");
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, ActionOnFailedAuthentication.INCREMENT_INCORRECT_LOGIN_ATTEMPT_COUNT);
         }
         return new Pair<Boolean, ActionOnFailedAuthentication>(true, null);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/user-authenticators/pbkdf2/src/org/apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/pbkdf2/src/org/apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java b/plugins/user-authenticators/pbkdf2/src/org/apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java
index 130950d..735405e 100644
--- a/plugins/user-authenticators/pbkdf2/src/org/apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java
+++ b/plugins/user-authenticators/pbkdf2/src/org/apache/cloudstack/server/auth/PBKDF2UserAuthenticator.java
@@ -23,7 +23,6 @@ import com.cloud.utils.ConstantTimeComparator;
 import com.cloud.utils.Pair;
 import com.cloud.utils.exception.CloudRuntimeException;
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
 import org.bouncycastle.crypto.PBEParametersGenerator;
 import org.bouncycastle.crypto.generators.PKCS5S2ParametersGenerator;
 import org.bouncycastle.crypto.params.KeyParameter;
@@ -41,7 +40,6 @@ import static java.lang.String.format;
 
 @Local({UserAuthenticator.class})
 public class PBKDF2UserAuthenticator extends DefaultUserAuthenticator {
-    public static final Logger s_logger = Logger.getLogger(PBKDF2UserAuthenticator.class);
     private static final int s_saltlen = 64;
     private static final int s_rounds = 100000;
     private static final int s_keylen = 512;
@@ -50,12 +48,12 @@ public class PBKDF2UserAuthenticator extends DefaultUserAuthenticator {
     private UserAccountDao _userAccountDao;
 
     public Pair<Boolean, UserAuthenticator.ActionOnFailedAuthentication> authenticate(String username, String password, Long domainId, Map<String, Object[]> requestParameters) {
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Retrieving user: " + username);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Retrieving user: " + username);
         }
 
         if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
-            s_logger.debug("Username or Password cannot be empty");
+            logger.debug("Username or Password cannot be empty");
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
         }
 
@@ -64,7 +62,7 @@ public class PBKDF2UserAuthenticator extends DefaultUserAuthenticator {
         if (user != null) {
             isValidUser = true;
         } else {
-            s_logger.debug("Unable to find user with " + username + " in domain " + domainId);
+            logger.debug("Unable to find user with " + username + " in domain " + domainId);
         }
 
         byte[] salt = new byte[0];
@@ -73,7 +71,7 @@ public class PBKDF2UserAuthenticator extends DefaultUserAuthenticator {
             if (isValidUser) {
                 String[] storedPassword = user.getPassword().split(":");
                 if ((storedPassword.length != 3) || (!StringUtils.isNumeric(storedPassword[2]))) {
-                    s_logger.warn("The stored password for " + username + " isn't in the right format for this authenticator");
+                    logger.warn("The stored password for " + username + " isn't in the right format for this authenticator");
                     isValidUser = false;
                 } else {
                     // Encoding format = <salt>:<password hash>:<rounds>
@@ -112,7 +110,7 @@ public class PBKDF2UserAuthenticator extends DefaultUserAuthenticator {
         } catch (UnsupportedEncodingException e) {
             throw new CloudRuntimeException("Unable to hash password", e);
         } catch (InvalidKeySpecException e) {
-            s_logger.error("Exception in EncryptUtil.createKey ", e);
+            logger.error("Exception in EncryptUtil.createKey ", e);
             throw new CloudRuntimeException("Unable to hash password", e);
         }
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/user-authenticators/plain-text/src/com/cloud/server/auth/PlainTextUserAuthenticator.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/plain-text/src/com/cloud/server/auth/PlainTextUserAuthenticator.java b/plugins/user-authenticators/plain-text/src/com/cloud/server/auth/PlainTextUserAuthenticator.java
index aaff27e..099feb9 100644
--- a/plugins/user-authenticators/plain-text/src/com/cloud/server/auth/PlainTextUserAuthenticator.java
+++ b/plugins/user-authenticators/plain-text/src/com/cloud/server/auth/PlainTextUserAuthenticator.java
@@ -19,7 +19,6 @@ import com.cloud.user.UserAccount;
 import com.cloud.user.dao.UserAccountDao;
 import com.cloud.utils.Pair;
 import org.apache.commons.lang.StringUtils;
-import org.apache.log4j.Logger;
 
 import javax.ejb.Local;
 import javax.inject.Inject;
@@ -27,30 +26,29 @@ import java.util.Map;
 
 @Local(value = {UserAuthenticator.class})
 public class PlainTextUserAuthenticator extends DefaultUserAuthenticator {
-    public static final Logger s_logger = Logger.getLogger(PlainTextUserAuthenticator.class);
 
     @Inject
     private UserAccountDao _userAccountDao;
 
     @Override
     public Pair<Boolean, ActionOnFailedAuthentication> authenticate(String username, String password, Long domainId, Map<String, Object[]> requestParameters) {
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Retrieving user: " + username);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Retrieving user: " + username);
         }
 
         if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
-            s_logger.debug("Username or Password cannot be empty");
+            logger.debug("Username or Password cannot be empty");
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
         }
 
         UserAccount user = _userAccountDao.getUserAccount(username, domainId);
         if (user == null) {
-            s_logger.debug("Unable to find user with " + username + " in domain " + domainId);
+            logger.debug("Unable to find user with " + username + " in domain " + domainId);
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
         }
 
         if (!user.getPassword().equals(password)) {
-            s_logger.debug("Password does not match");
+            logger.debug("Password does not match");
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, ActionOnFailedAuthentication.INCREMENT_INCORRECT_LOGIN_ATTEMPT_COUNT);
         }
         return new Pair<Boolean, ActionOnFailedAuthentication>(true, null);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2AuthManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2AuthManagerImpl.java b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2AuthManagerImpl.java
index a8740ac..455f28e 100644
--- a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2AuthManagerImpl.java
+++ b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2AuthManagerImpl.java
@@ -37,7 +37,6 @@ import org.apache.cloudstack.framework.security.keystore.KeystoreDao;
 import org.apache.cloudstack.framework.security.keystore.KeystoreVO;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.httpclient.HttpClient;
-import org.apache.log4j.Logger;
 import org.opensaml.DefaultBootstrap;
 import org.opensaml.common.xml.SAMLConstants;
 import org.opensaml.saml2.metadata.ContactPerson;
@@ -93,7 +92,6 @@ import java.util.TimerTask;
 @Component
 @Local(value = {SAML2AuthManager.class, PluggableAPIAuthenticator.class})
 public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManager, Configurable {
-    private static final Logger s_logger = Logger.getLogger(SAML2AuthManagerImpl.class);
 
     private SAMLProviderMetadata _spMetadata = new SAMLProviderMetadata();
     private Map<String, SAMLProviderMetadata> _idpMetadataMap = new HashMap<String, SAMLProviderMetadata>();
@@ -124,10 +122,10 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
     @Override
     public boolean start() {
         if (isSAMLPluginEnabled()) {
-            s_logger.info("SAML auth plugin loaded");
+            logger.info("SAML auth plugin loaded");
             return setup();
         } else {
-            s_logger.info("SAML auth plugin not enabled so not loading");
+            logger.info("SAML auth plugin not enabled so not loading");
             return super.start();
         }
     }
@@ -147,9 +145,9 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
                 KeyPair keyPair = SAMLUtils.generateRandomKeyPair();
                 _ksDao.save(SAMLPluginConstants.SAMLSP_KEYPAIR, SAMLUtils.savePrivateKey(keyPair.getPrivate()), SAMLUtils.savePublicKey(keyPair.getPublic()), "samlsp-keypair");
                 keyStoreVO = _ksDao.findByName(SAMLPluginConstants.SAMLSP_KEYPAIR);
-                s_logger.info("No SAML keystore found, created and saved a new Service Provider keypair");
+                logger.info("No SAML keystore found, created and saved a new Service Provider keypair");
             } catch (NoSuchProviderException | NoSuchAlgorithmException e) {
-                s_logger.error("Unable to create and save SAML keypair: " + e.toString());
+                logger.error("Unable to create and save SAML keypair: " + e.toString());
             }
         }
 
@@ -178,7 +176,7 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
                         _ksDao.save(SAMLPluginConstants.SAMLSP_X509CERT, Base64.encodeBase64String(bos.toByteArray()), "", "samlsp-x509cert");
                         bos.close();
                     } catch (NoSuchAlgorithmException | NoSuchProviderException | CertificateEncodingException | SignatureException | InvalidKeyException | IOException e) {
-                        s_logger.error("SAML Plugin won't be able to use X509 signed authentication");
+                        logger.error("SAML Plugin won't be able to use X509 signed authentication");
                     }
                 } else {
                     try {
@@ -187,7 +185,7 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
                         spX509Key = (X509Certificate) si.readObject();
                         bi.close();
                     } catch (IOException | ClassNotFoundException ignored) {
-                        s_logger.error("SAML Plugin won't be able to use X509 signed authentication. Failed to load X509 Certificate from Database.");
+                        logger.error("SAML Plugin won't be able to use X509 signed authentication. Failed to load X509 Certificate from Database.");
                     }
                 }
             }
@@ -214,7 +212,7 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
     private void addIdpToMap(EntityDescriptor descriptor, Map<String, SAMLProviderMetadata> idpMap) {
         SAMLProviderMetadata idpMetadata = new SAMLProviderMetadata();
         idpMetadata.setEntityId(descriptor.getEntityID());
-        s_logger.debug("Adding IdP to the list of discovered IdPs: " + descriptor.getEntityID());
+        logger.debug("Adding IdP to the list of discovered IdPs: " + descriptor.getEntityID());
         if (descriptor.getOrganization() != null) {
             if (descriptor.getOrganization().getDisplayNames() != null) {
                 for (OrganizationDisplayName orgName : descriptor.getOrganization().getDisplayNames()) {
@@ -288,21 +286,21 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
                         try {
                             idpMetadata.setSigningCertificate(KeyInfoHelper.getCertificates(kd.getKeyInfo()).get(0));
                         } catch (CertificateException ignored) {
-                            s_logger.info("[ignored] encountered invalid certificate signing.", ignored);
+                            logger.info("[ignored] encountered invalid certificate signing.", ignored);
                         }
                     }
                     if (kd.getUse() == UsageType.ENCRYPTION) {
                         try {
                             idpMetadata.setEncryptionCertificate(KeyInfoHelper.getCertificates(kd.getKeyInfo()).get(0));
                         } catch (CertificateException ignored) {
-                            s_logger.info("[ignored] encountered invalid certificate encryption.", ignored);
+                            logger.info("[ignored] encountered invalid certificate encryption.", ignored);
                         }
                     }
                     if (kd.getUse() == UsageType.UNSPECIFIED) {
                         try {
                             unspecifiedKey = KeyInfoHelper.getCertificates(kd.getKeyInfo()).get(0);
                         } catch (CertificateException ignored) {
-                            s_logger.info("[ignored] encountered invalid certificate.", ignored);
+                            logger.info("[ignored] encountered invalid certificate.", ignored);
                         }
                     }
                 }
@@ -314,7 +312,7 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
                 idpMetadata.setEncryptionCertificate(unspecifiedKey);
             }
             if (idpMap.containsKey(idpMetadata.getEntityId())) {
-                s_logger.warn("Duplicate IdP metadata found with entity Id: " + idpMetadata.getEntityId());
+                logger.warn("Duplicate IdP metadata found with entity Id: " + idpMetadata.getEntityId());
             }
             idpMap.put(idpMetadata.getEntityId(), idpMetadata);
         }
@@ -345,16 +343,16 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
             if (_idpMetaDataProvider == null) {
                 return;
             }
-            s_logger.debug("Starting SAML IDP Metadata Refresh Task");
+            logger.debug("Starting SAML IDP Metadata Refresh Task");
 
             Map <String, SAMLProviderMetadata> metadataMap = new HashMap<String, SAMLProviderMetadata>();
             try {
                 discoverAndAddIdp(_idpMetaDataProvider.getMetadata(), metadataMap);
                 _idpMetadataMap = metadataMap;
                 expireTokens();
-                s_logger.debug("Finished refreshing SAML Metadata and expiring old auth tokens");
+                logger.debug("Finished refreshing SAML Metadata and expiring old auth tokens");
             } catch (MetadataProviderException e) {
-                s_logger.warn("SAML Metadata Refresh task failed with exception: " + e.getMessage());
+                logger.warn("SAML Metadata Refresh task failed with exception: " + e.getMessage());
             }
 
         }
@@ -362,7 +360,7 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
 
     private boolean setup() {
         if (!initSP()) {
-            s_logger.error("SAML Plugin failed to initialize, please fix the configuration and restart management server");
+            logger.error("SAML Plugin failed to initialize, please fix the configuration and restart management server");
             return false;
         }
         _timer = new Timer();
@@ -378,11 +376,11 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
             } else {
                 File metadataFile = PropertiesUtil.findConfigFile(idpMetaDataUrl);
                 if (metadataFile == null) {
-                    s_logger.error("Provided Metadata is not a URL, Unable to locate metadata file from local path: " + idpMetaDataUrl);
+                    logger.error("Provided Metadata is not a URL, Unable to locate metadata file from local path: " + idpMetaDataUrl);
                     return false;
                 }
                 else{
-                    s_logger.debug("Provided Metadata is not a URL, trying to read metadata file from local path: " + metadataFile.getAbsolutePath());
+                    logger.debug("Provided Metadata is not a URL, trying to read metadata file from local path: " + metadataFile.getAbsolutePath());
                     _idpMetaDataProvider = new FilesystemMetadataProvider(_timer, metadataFile);
                 }
             }
@@ -392,14 +390,14 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
             _timer.scheduleAtFixedRate(new MetadataRefreshTask(), 0, _refreshInterval * 1000);
 
         } catch (MetadataProviderException e) {
-            s_logger.error("Unable to read SAML2 IDP MetaData URL, error:" + e.getMessage());
-            s_logger.error("SAML2 Authentication may be unavailable");
+            logger.error("Unable to read SAML2 IDP MetaData URL, error:" + e.getMessage());
+            logger.error("SAML2 Authentication may be unavailable");
             return false;
         } catch (ConfigurationException | FactoryConfigurationError e) {
-            s_logger.error("OpenSAML bootstrapping failed: error: " + e.getMessage());
+            logger.error("OpenSAML bootstrapping failed: error: " + e.getMessage());
             return false;
         } catch (NullPointerException e) {
-            s_logger.error("Unable to setup SAML Auth Plugin due to NullPointerException" +
+            logger.error("Unable to setup SAML Auth Plugin due to NullPointerException" +
                     " please check the SAML global settings: " + e.getMessage());
             return false;
         }
@@ -477,7 +475,7 @@ public class SAML2AuthManagerImpl extends AdapterBase implements SAML2AuthManage
         if (_samlTokenDao.findByUuid(authnId) == null) {
             _samlTokenDao.persist(token);
         } else {
-            s_logger.warn("Duplicate SAML token for entity=" + entity + " token id=" + authnId + " domain=" + domainPath);
+            logger.warn("Duplicate SAML token for entity=" + entity + " token id=" + authnId + " domain=" + domainPath);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2UserAuthenticator.java
----------------------------------------------------------------------
diff --git a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2UserAuthenticator.java b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2UserAuthenticator.java
index 65a7959..fd507ae 100644
--- a/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2UserAuthenticator.java
+++ b/plugins/user-authenticators/saml2/src/org/apache/cloudstack/saml/SAML2UserAuthenticator.java
@@ -22,7 +22,6 @@ import com.cloud.user.dao.UserAccountDao;
 import com.cloud.user.dao.UserDao;
 import com.cloud.utils.Pair;
 import org.apache.cxf.common.util.StringUtils;
-import org.apache.log4j.Logger;
 
 import javax.ejb.Local;
 import javax.inject.Inject;
@@ -30,7 +29,6 @@ import java.util.Map;
 
 @Local(value = {UserAuthenticator.class})
 public class SAML2UserAuthenticator extends DefaultUserAuthenticator {
-    public static final Logger s_logger = Logger.getLogger(SAML2UserAuthenticator.class);
 
     @Inject
     private UserAccountDao _userAccountDao;
@@ -39,18 +37,18 @@ public class SAML2UserAuthenticator extends DefaultUserAuthenticator {
 
     @Override
     public Pair<Boolean, ActionOnFailedAuthentication> authenticate(String username, String password, Long domainId, Map<String, Object[]> requestParameters) {
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Trying SAML2 auth for user: " + username);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Trying SAML2 auth for user: " + username);
         }
 
         if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
-            s_logger.debug("Username or Password cannot be empty");
+            logger.debug("Username or Password cannot be empty");
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
         }
 
         final UserAccount userAccount = _userAccountDao.getUserAccount(username, domainId);
         if (userAccount == null || userAccount.getSource() != User.Source.SAML2) {
-            s_logger.debug("Unable to find user with " + username + " in domain " + domainId + ", or user source is not SAML2");
+            logger.debug("Unable to find user with " + username + " in domain " + domainId + ", or user source is not SAML2");
             return new Pair<Boolean, ActionOnFailedAuthentication>(false, null);
         } else {
             User user = _userDao.getUser(userAccount.getId());


Mime
View raw message