cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [12/36] git commit: updated refs/heads/master to cd7218e
Date Sat, 29 Aug 2015 20:06:09 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/network/NetworkUsageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/NetworkUsageManagerImpl.java b/server/src/com/cloud/network/NetworkUsageManagerImpl.java
index fa4eb16..ebfeed1 100644
--- a/server/src/com/cloud/network/NetworkUsageManagerImpl.java
+++ b/server/src/com/cloud/network/NetworkUsageManagerImpl.java
@@ -29,7 +29,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.api.command.admin.usage.AddTrafficMonitorCmd;
@@ -99,7 +98,6 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
         TrafficSentinel;
     }
 
-    private static final org.apache.log4j.Logger s_logger = Logger.getLogger(NetworkUsageManagerImpl.class);
     @Inject
     HostDao _hostDao;
     @Inject
@@ -152,7 +150,7 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
         try {
             uri = new URI(cmd.getUrl());
         } catch (Exception e) {
-            s_logger.debug(e);
+            logger.debug(e);
             throw new InvalidParameterValueException(e.getMessage());
         }
 
@@ -278,11 +276,11 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
             HostVO host = _hostDao.findById(agentId);
             if (host != null) {
                 if ((host.getManagementServerId() == null) || (mgmtSrvrId != host.getManagementServerId())) {
-                    s_logger.warn("Not the owner. Not collecting Direct Network usage from  TrafficMonitor : " + agentId);
+                    logger.warn("Not the owner. Not collecting Direct Network usage from  TrafficMonitor : " + agentId);
                     return false;
                 }
             } else {
-                s_logger.warn("Agent not found. Not collecting Direct Network usage from  TrafficMonitor : " + agentId);
+                logger.warn("Agent not found. Not collecting Direct Network usage from  TrafficMonitor : " + agentId);
                 return false;
             }
 
@@ -302,12 +300,12 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
         }
 
         private boolean collectDirectNetworkUsage(final HostVO host) {
-            s_logger.debug("Direct Network Usage stats collector is running...");
+            logger.debug("Direct Network Usage stats collector is running...");
 
             final long zoneId = host.getDataCenterId();
             final DetailVO lastCollectDetail = _detailsDao.findDetail(host.getId(), "last_collection");
             if (lastCollectDetail == null) {
-                s_logger.warn("Last collection time not available. Skipping direct usage collection for Traffic Monitor: " + host.getId());
+                logger.warn("Last collection time not available. Skipping direct usage collection for Traffic Monitor: " + host.getId());
                 return false;
             }
             Date lastCollection = new Date(Long.parseLong(lastCollectDetail.getValue()));
@@ -323,7 +321,7 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
             final Date now = rightNow.getTime();
 
             if (lastCollection.after(now)) {
-                s_logger.debug("Current time is less than 2 hours after last collection time : " + lastCollection.toString() +
+                logger.debug("Current time is less than 2 hours after last collection time : " + lastCollection.toString() +
                     ". Skipping direct network usage collection");
                 return false;
             }
@@ -382,7 +380,7 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
                 if (answer == null || !answer.getResult()) {
                     String details = (answer != null) ? answer.getDetails() : "details unavailable";
                     String msg = "Unable to get network usage stats from " + host.getId() + " due to: " + details + ".";
-                    s_logger.error(msg);
+                    logger.error(msg);
                     return false;
                 } else {
                     for (UsageIPAddressVO usageIp : fullDurationIpUsage) {
@@ -391,11 +389,11 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
                         Long bytesSent = bytesSentRcvd[0];
                         Long bytesRcvd = bytesSentRcvd[1];
                         if (bytesSent == null || bytesRcvd == null) {
-                            s_logger.debug("Incorrect bytes for IP: " + publicIp);
+                            logger.debug("Incorrect bytes for IP: " + publicIp);
                             continue;
                         }
                         if (bytesSent == 0L && bytesRcvd == 0L) {
-                            s_logger.trace("Ignore zero bytes for IP: " + publicIp);
+                            logger.trace("Ignore zero bytes for IP: " + publicIp);
                             continue;
                         }
                         UserStatisticsVO stats = new UserStatisticsVO(usageIp.getAccountId(), zoneId, null, null, null, null);
@@ -415,7 +413,7 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
                 if (answer == null || !answer.getResult()) {
                     String details = (answer != null) ? answer.getDetails() : "details unavailable";
                     String msg = "Unable to get network usage stats from " + host.getId() + " due to: " + details + ".";
-                    s_logger.error(msg);
+                    logger.error(msg);
                     return false;
                 } else {
                     String publicIp = usageIp.getAddress();
@@ -423,11 +421,11 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
                     Long bytesSent = bytesSentRcvd[0];
                     Long bytesRcvd = bytesSentRcvd[1];
                     if (bytesSent == null || bytesRcvd == null) {
-                        s_logger.debug("Incorrect bytes for IP: " + publicIp);
+                        logger.debug("Incorrect bytes for IP: " + publicIp);
                         continue;
                     }
                     if (bytesSent == 0L && bytesRcvd == 0L) {
-                        s_logger.trace("Ignore zero bytes for IP: " + publicIp);
+                        logger.trace("Ignore zero bytes for IP: " + publicIp);
                         continue;
                     }
                     UserStatisticsVO stats = new UserStatisticsVO(usageIp.getAccountId(), zoneId, null, null, null, null);
@@ -439,7 +437,7 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
             }
 
             if (collectedStats.size() == 0) {
-                s_logger.debug("No new direct network stats. No need to persist");
+                logger.debug("No new direct network stats. No need to persist");
                 return false;
             }
             //Persist all the stats and last_collection time in a single transaction
@@ -479,8 +477,8 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
 
         @Override
         public boolean processDisconnect(long agentId, Status state) {
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("Disconnected called on " + agentId + " with status " + state.toString());
+            if (logger.isDebugEnabled()) {
+                logger.debug("Disconnected called on " + agentId + " with status " + state.toString());
             }
             return true;
         }
@@ -489,12 +487,12 @@ public class NetworkUsageManagerImpl extends ManagerBase implements NetworkUsage
         public void processConnect(Host agent, StartupCommand cmd, boolean forRebalance) {
             if (cmd instanceof StartupTrafficMonitorCommand) {
                 long agentId = agent.getId();
-                s_logger.debug("Sending RecurringNetworkUsageCommand to " + agentId);
+                logger.debug("Sending RecurringNetworkUsageCommand to " + agentId);
                 RecurringNetworkUsageCommand watch = new RecurringNetworkUsageCommand(_interval);
                 try {
                     _agentMgr.send(agentId, new Commands(watch), this);
                 } catch (AgentUnavailableException e) {
-                    s_logger.debug("Can not process connect for host " + agentId, e);
+                    logger.debug("Can not process connect for host " + agentId, e);
                 }
             }
             return;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/network/StorageNetworkManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/StorageNetworkManagerImpl.java b/server/src/com/cloud/network/StorageNetworkManagerImpl.java
index 76a51d9..d155376 100644
--- a/server/src/com/cloud/network/StorageNetworkManagerImpl.java
+++ b/server/src/com/cloud/network/StorageNetworkManagerImpl.java
@@ -24,7 +24,6 @@ import java.util.List;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.api.command.admin.network.CreateStorageNetworkIpRangeCmd;
@@ -61,7 +60,6 @@ import com.cloud.vm.dao.SecondaryStorageVmDao;
 @Component
 @Local(value = {StorageNetworkManager.class, StorageNetworkService.class})
 public class StorageNetworkManagerImpl extends ManagerBase implements StorageNetworkManager, StorageNetworkService {
-    private static final Logger s_logger = Logger.getLogger(StorageNetworkManagerImpl.class);
 
     @Inject
     StorageNetworkIpAddressDao _sNwIpDao;
@@ -240,7 +238,7 @@ public class StorageNetworkManagerImpl extends ManagerBase implements StorageNet
                     err.append("endIp=" + endIpFinal);
                     err.append("netmask=" + netmask);
                     err.append("zoneId=" + zoneId);
-                    s_logger.debug(err.toString(), e);
+                    logger.debug(err.toString(), e);
                     throw e;
                 }
 
@@ -280,7 +278,7 @@ public class StorageNetworkManagerImpl extends ManagerBase implements StorageNet
                     range = _sNwIpRangeDao.acquireInLockTable(rangeId);
                     if (range == null) {
                         String msg = "Unable to acquire lock on storage network ip range id=" + rangeId + ", delete failed";
-                        s_logger.warn(msg);
+                        logger.warn(msg);
                         throw new CloudRuntimeException(msg);
                     }
                     /*
@@ -332,7 +330,7 @@ public class StorageNetworkManagerImpl extends ManagerBase implements StorageNet
                 r = _sNwIpRangeDao.acquireInLockTable(rangeId);
                 if (r == null) {
                     String msg = "Unable to acquire lock on storage network ip range id=" + rangeId + ", delete failed";
-                    s_logger.warn(msg);
+                    logger.warn(msg);
                     throw new CloudRuntimeException(msg);
                 }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
index 01c1486..d372f81 100644
--- a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
+++ b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java
@@ -30,7 +30,6 @@ import java.util.concurrent.TimeUnit;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 
 import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
@@ -127,7 +126,6 @@ import com.cloud.vm.UserVmService;
 
 @Local(value = {AutoScaleService.class, AutoScaleManager.class})
 public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScaleManager, AutoScaleService {
-    private static final Logger s_logger = Logger.getLogger(AutoScaleManagerImpl.class);
     private ScheduledExecutorService _executor = Executors.newScheduledThreadPool(1);
 
     @Inject
@@ -382,7 +380,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         }
 
         profileVO = checkValidityAndPersist(profileVO);
-        s_logger.info("Successfully create AutoScale Vm Profile with Id: " + profileVO.getId());
+        logger.info("Successfully create AutoScale Vm Profile with Id: " + profileVO.getId());
 
         return profileVO;
     }
@@ -433,7 +431,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         }
 
         vmProfile = checkValidityAndPersist(vmProfile);
-        s_logger.info("Updated Auto Scale Vm Profile id:" + vmProfile.getId());
+        logger.info("Updated Auto Scale Vm Profile id:" + vmProfile.getId());
 
         return vmProfile;
     }
@@ -448,7 +446,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         }
         boolean success = _autoScaleVmProfileDao.remove(id);
         if (success) {
-            s_logger.info("Successfully deleted AutoScale Vm Profile with Id: " + id);
+            logger.info("Successfully deleted AutoScale Vm Profile with Id: " + id);
         }
         return success;
     }
@@ -577,7 +575,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         AutoScalePolicyVO policyVO = new AutoScalePolicyVO(cmd.getDomainId(), cmd.getAccountId(), duration, quietTime, null, action);
 
         policyVO = checkValidityAndPersist(policyVO, cmd.getConditionIds());
-        s_logger.info("Successfully created AutoScale Policy with Id: " + policyVO.getId());
+        logger.info("Successfully created AutoScale Policy with Id: " + policyVO.getId());
         return policyVO;
     }
 
@@ -598,15 +596,15 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
                 boolean success = true;
                 success = _autoScalePolicyDao.remove(id);
                 if (!success) {
-                    s_logger.warn("Failed to remove AutoScale Policy db object");
+                    logger.warn("Failed to remove AutoScale Policy db object");
                     return false;
                 }
                 success = _autoScalePolicyConditionMapDao.removeByAutoScalePolicyId(id);
                 if (!success) {
-                    s_logger.warn("Failed to remove AutoScale Policy Condition mappings");
+                    logger.warn("Failed to remove AutoScale Policy Condition mappings");
                     return false;
                 }
-                s_logger.info("Successfully deleted autoscale policy id : " + id);
+                logger.info("Successfully deleted autoscale policy id : " + id);
 
                 return success;
             }
@@ -738,7 +736,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         for (AutoScaleVmGroupPolicyMapVO vmGroupPolicy : vmGroupPolicyList) {
             AutoScaleVmGroupVO vmGroupVO = _autoScaleVmGroupDao.findById(vmGroupPolicy.getVmGroupId());
             if (vmGroupVO == null) {
-                s_logger.warn("Stale database entry! There is an entry in VmGroupPolicyMap but the vmGroup is missing:" + vmGroupPolicy.getVmGroupId());
+                logger.warn("Stale database entry! There is an entry in VmGroupPolicyMap but the vmGroup is missing:" + vmGroupPolicy.getVmGroupId());
 
                 continue;
 
@@ -752,7 +750,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         }
 
         policy = checkValidityAndPersist(policy, conditionIds);
-        s_logger.info("Successfully updated Auto Scale Policy id:" + policyId);
+        logger.info("Successfully updated Auto Scale Policy id:" + policyId);
         return policy;
     }
 
@@ -789,7 +787,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         }
 
         vmGroupVO = checkValidityAndPersist(vmGroupVO, cmd.getScaleUpPolicyIds(), cmd.getScaleDownPolicyIds());
-        s_logger.info("Successfully created Autoscale Vm Group with Id: " + vmGroupVO.getId());
+        logger.info("Successfully created Autoscale Vm Group with Id: " + vmGroupVO.getId());
 
         return vmGroupVO;
     }
@@ -813,7 +811,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
             } catch (ResourceUnavailableException re) {
                 throw re;
             } catch (Exception e) {
-                s_logger.warn("Exception during configureLbAutoScaleVmGroup in lb rules manager", e);
+                logger.warn("Exception during configureLbAutoScaleVmGroup in lb rules manager", e);
                 return false;
             }
         }
@@ -844,7 +842,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
             _autoScaleVmGroupDao.persist(autoScaleVmGroupVO);
         } finally {
             if (!success) {
-                s_logger.warn("Could not delete AutoScale Vm Group id : " + id);
+                logger.warn("Could not delete AutoScale Vm Group id : " + id);
                 return false;
             }
         }
@@ -855,17 +853,17 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
                 boolean success = _autoScaleVmGroupDao.remove(id);
 
                 if (!success) {
-                    s_logger.warn("Failed to remove AutoScale Group db object");
+                    logger.warn("Failed to remove AutoScale Group db object");
                     return false;
                 }
 
                 success = _autoScaleVmGroupPolicyMapDao.removeByGroupId(id);
                 if (!success) {
-                    s_logger.warn("Failed to remove AutoScale Group Policy mappings");
+                    logger.warn("Failed to remove AutoScale Group Policy mappings");
                     return false;
                 }
 
-                s_logger.info("Successfully deleted autoscale vm group id : " + id);
+                logger.info("Successfully deleted autoscale vm group id : " + id);
                 return success; // Successfull
             }
         });
@@ -1039,7 +1037,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
 
         vmGroupVO = checkValidityAndPersist(vmGroupVO, scaleUpPolicyIds, scaleDownPolicyIds);
         if (vmGroupVO != null) {
-            s_logger.debug("Updated Auto Scale VmGroup id:" + vmGroupId);
+            logger.debug("Updated Auto Scale VmGroup id:" + vmGroupId);
             return vmGroupVO;
         } else
             return null;
@@ -1064,10 +1062,10 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
             _autoScaleVmGroupDao.persist(vmGroup);
         } finally {
             if (!success) {
-                s_logger.warn("Failed to enable AutoScale Vm Group id : " + id);
+                logger.warn("Failed to enable AutoScale Vm Group id : " + id);
                 return null;
             }
-            s_logger.info("Successfully enabled AutoScale Vm Group with Id:" + id);
+            logger.info("Successfully enabled AutoScale Vm Group with Id:" + id);
         }
         return vmGroup;
     }
@@ -1091,10 +1089,10 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
             _autoScaleVmGroupDao.persist(vmGroup);
         } finally {
             if (!success) {
-                s_logger.warn("Failed to disable AutoScale Vm Group id : " + id);
+                logger.warn("Failed to disable AutoScale Vm Group id : " + id);
                 return null;
             }
-            s_logger.info("Successfully disabled AutoScale Vm Group with Id:" + id);
+            logger.info("Successfully disabled AutoScale Vm Group with Id:" + id);
         }
         return vmGroup;
     }
@@ -1115,7 +1113,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
 
         CounterVO counter = null;
 
-        s_logger.debug("Adding Counter " + name);
+        logger.debug("Adding Counter " + name);
         counter = _counterDao.persist(new CounterVO(src, name, cmd.getValue()));
 
         CallContext.current().setEventDetails(" Id: " + counter.getId() + " Name: " + name);
@@ -1146,7 +1144,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         ConditionVO condition = null;
 
         condition = _conditionDao.persist(new ConditionVO(cid, threshold, cmd.getEntityOwnerId(), cmd.getDomainId(), op));
-        s_logger.info("Successfully created condition with Id: " + condition.getId());
+        logger.info("Successfully created condition with Id: " + condition.getId());
 
         CallContext.current().setEventDetails(" Id: " + condition.getId());
         return condition;
@@ -1215,13 +1213,13 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
 
         ConditionVO condition = _conditionDao.findByCounterId(counterId);
         if (condition != null) {
-            s_logger.info("Cannot delete counter " + counter.getName() + " as it is being used in a condition.");
+            logger.info("Cannot delete counter " + counter.getName() + " as it is being used in a condition.");
             throw new ResourceInUseException("Counter is in use.");
         }
 
         boolean success = _counterDao.remove(counterId);
         if (success) {
-            s_logger.info("Successfully deleted counter with Id: " + counterId);
+            logger.info("Successfully deleted counter with Id: " + counterId);
         }
 
         return success;
@@ -1238,12 +1236,12 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
 
         // Verify if condition is used in any autoscale policy
         if (_autoScalePolicyConditionMapDao.isConditionInUse(conditionId)) {
-            s_logger.info("Cannot delete condition " + conditionId + " as it is being used in a condition.");
+            logger.info("Cannot delete condition " + conditionId + " as it is being used in a condition.");
             throw new ResourceInUseException("Cannot delete Condition when it is in use by one or more AutoScale Policies.");
         }
         boolean success = _conditionDao.remove(conditionId);
         if (success) {
-            s_logger.info("Successfully deleted condition " + condition.getId());
+            logger.info("Successfully deleted condition " + condition.getId());
         }
         return success;
     }
@@ -1254,15 +1252,15 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         int count = 0;
         count = _autoScaleVmProfileDao.removeByAccountId(accountId);
         if (count > 0) {
-            s_logger.debug("Deleted " + count + " AutoScale Vm Profile for account Id: " + accountId);
+            logger.debug("Deleted " + count + " AutoScale Vm Profile for account Id: " + accountId);
         }
         count = _autoScalePolicyDao.removeByAccountId(accountId);
         if (count > 0) {
-            s_logger.debug("Deleted " + count + " AutoScale Policies for account Id: " + accountId);
+            logger.debug("Deleted " + count + " AutoScale Policies for account Id: " + accountId);
         }
         count = _conditionDao.removeByAccountId(accountId);
         if (count > 0) {
-            s_logger.debug("Deleted " + count + " Conditions for account Id: " + accountId);
+            logger.debug("Deleted " + count + " Conditions for account Id: " + accountId);
         }
     }
 
@@ -1271,7 +1269,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         Integer currentVM = _autoScaleVmGroupVmMapDao.countByGroup(asGroup.getId());
         Integer maxVm = asGroup.getMaxMembers();
         if (currentVM + numVm > maxVm) {
-            s_logger.warn("number of VM will greater than the maximum in this group if scaling up, so do nothing more");
+            logger.warn("number of VM will greater than the maximum in this group if scaling up, so do nothing more");
             return false;
         }
         return true;
@@ -1281,7 +1279,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         Integer currentVM = _autoScaleVmGroupVmMapDao.countByGroup(asGroup.getId());
         Integer minVm = asGroup.getMinMembers();
         if (currentVM - 1 < minVm) {
-            s_logger.warn("number of VM will less than the minimum in this group if scaling down, so do nothing more");
+            logger.warn("number of VM will less than the minimum in this group if scaling down, so do nothing more");
             return false;
         }
         return true;
@@ -1349,17 +1347,17 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
                 return -1;
             }
         } catch (InsufficientCapacityException ex) {
-            s_logger.info(ex);
-            s_logger.trace(ex.getMessage(), ex);
+            logger.info(ex);
+            logger.trace(ex.getMessage(), ex);
             throw new ServerApiException(ApiErrorCode.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
         } catch (ResourceUnavailableException ex) {
-            s_logger.warn("Exception: ", ex);
+            logger.warn("Exception: ", ex);
             throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
         } catch (ConcurrentOperationException ex) {
-            s_logger.warn("Exception: ", ex);
+            logger.warn("Exception: ", ex);
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
         } catch (ResourceAllocationException ex) {
-            s_logger.warn("Exception: ", ex);
+            logger.warn("Exception: ", ex);
             throw new ServerApiException(ApiErrorCode.RESOURCE_ALLOCATION_ERROR, ex.getMessage());
         }
     }
@@ -1376,10 +1374,10 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
             CallContext.current().setEventDetails("Vm Id: " + vmId);
             _userVmManager.startVirtualMachine(vmId, null, null, null);
         } catch (final ResourceUnavailableException ex) {
-            s_logger.warn("Exception: ", ex);
+            logger.warn("Exception: ", ex);
             throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage());
         } catch (ConcurrentOperationException ex) {
-            s_logger.warn("Exception: ", ex);
+            logger.warn("Exception: ", ex);
             throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
         } catch (InsufficientCapacityException ex) {
             StringBuilder message = new StringBuilder(ex.getMessage());
@@ -1388,8 +1386,8 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
                     message.append(", Please check the affinity groups provided, there may not be sufficient capacity to follow them");
                 }
             }
-            s_logger.info(ex);
-            s_logger.info(message.toString(), ex);
+            logger.info(ex);
+            logger.info(message.toString(), ex);
             throw new ServerApiException(ApiErrorCode.INSUFFICIENT_CAPACITY_ERROR, message.toString());
         }
         return true;
@@ -1404,7 +1402,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
             for (LoadBalancerVMMapVO LbVmMapVo : LbVmMapVos) {
                 long instanceId = LbVmMapVo.getInstanceId();
                 if (instanceId == vmId) {
-                    s_logger.warn("the new VM is already mapped to LB rule. What's wrong?");
+                    logger.warn("the new VM is already mapped to LB rule. What's wrong?");
                     return true;
                 }
             }
@@ -1437,7 +1435,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
     public void doScaleUp(long groupId, Integer numVm) {
         AutoScaleVmGroupVO asGroup = _autoScaleVmGroupDao.findById(groupId);
         if (asGroup == null) {
-            s_logger.error("Can not find the groupid " + groupId + " for scaling up");
+            logger.error("Can not find the groupid " + groupId + " for scaling up");
             return;
         }
         if (!checkConditionUp(asGroup, numVm)) {
@@ -1446,7 +1444,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
         for (int i = 0; i < numVm; i++) {
             long vmId = createNewVM(asGroup);
             if (vmId == -1) {
-                s_logger.error("Can not deploy new VM for scaling up in the group "
+                logger.error("Can not deploy new VM for scaling up in the group "
                     + asGroup.getId() + ". Waiting for next round");
                 break;
             }
@@ -1469,11 +1467,11 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
                         }
                     }
                 } else {
-                    s_logger.error("Can not assign LB rule for this new VM");
+                    logger.error("Can not assign LB rule for this new VM");
                     break;
                 }
             } else {
-                s_logger.error("Can not deploy new VM for scaling up in the group "
+                logger.error("Can not deploy new VM for scaling up in the group "
                     + asGroup.getId() + ". Waiting for next round");
                 break;
             }
@@ -1484,7 +1482,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
     public void doScaleDown(final long groupId) {
         AutoScaleVmGroupVO asGroup = _autoScaleVmGroupDao.findById(groupId);
         if (asGroup == null) {
-            s_logger.error("Can not find the groupid " + groupId + " for scaling up");
+            logger.error("Can not find the groupid " + groupId + " for scaling up");
             return;
         }
         if (!checkConditionDown(asGroup)) {
@@ -1527,7 +1525,7 @@ public class AutoScaleManagerImpl<Type> extends ManagerBase implements AutoScale
                 }, destroyVmGracePeriod, TimeUnit.SECONDS);
             }
         } else {
-            s_logger.error("Can not remove LB rule for the VM being destroyed. Do nothing more.");
+            logger.error("Can not remove LB rule for the VM being destroyed. Do nothing more.");
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/CloudZonesNetworkElement.java b/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
index 5dfc127..0346fd5 100644
--- a/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
+++ b/server/src/com/cloud/network/element/CloudZonesNetworkElement.java
@@ -23,7 +23,6 @@ import java.util.Set;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 
 import com.cloud.agent.AgentManager;
 import com.cloud.agent.api.Answer;
@@ -62,7 +61,6 @@ import com.cloud.vm.dao.UserVmDao;
 
 @Local(value = NetworkElement.class)
 public class CloudZonesNetworkElement extends AdapterBase implements NetworkElement, UserDataServiceProvider {
-    private static final Logger s_logger = Logger.getLogger(CloudZonesNetworkElement.class);
 
     private static final Map<Service, Map<Capability, String>> capabilities = setCapabilities();
 
@@ -227,15 +225,15 @@ public class CloudZonesNetworkElement extends AdapterBase implements NetworkElem
             try {
                 _agentManager.send(dest.getHost().getId(), cmds);
             } catch (OperationTimedoutException e) {
-                s_logger.debug("Unable to send vm data command to host " + dest.getHost());
+                logger.debug("Unable to send vm data command to host " + dest.getHost());
                 return false;
             }
             Answer dataAnswer = cmds.getAnswer("vmdata");
             if (dataAnswer != null && dataAnswer.getResult()) {
-                s_logger.info("Sent vm data successfully to vm " + uservm.getInstanceName());
+                logger.info("Sent vm data successfully to vm " + uservm.getInstanceName());
                 return true;
             }
-            s_logger.info("Failed to send vm data to vm " + uservm.getInstanceName());
+            logger.info("Failed to send vm data to vm " + uservm.getInstanceName());
             return false;
         }
         return false;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/network/element/HAProxyLBRule.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/HAProxyLBRule.java b/server/src/com/cloud/network/element/HAProxyLBRule.java
new file mode 100644
index 0000000..406ef27
--- /dev/null
+++ b/server/src/com/cloud/network/element/HAProxyLBRule.java
@@ -0,0 +1,134 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+package com.cloud.network.element;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.springframework.stereotype.Component;
+
+import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.network.lb.LoadBalancingRule;
+import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
+import com.cloud.network.rules.LbStickinessMethod.StickinessMethodType;
+import com.cloud.utils.Pair;
+import com.cloud.utils.net.NetUtils;
+
+@Component
+public class HAProxyLBRule {
+
+    private Logger logger = Logger.getLogger(getClass());
+
+    public boolean validateHAProxyLBRule(final LoadBalancingRule rule) {
+        final String timeEndChar = "dhms";
+
+        if (rule.getSourcePortStart() == NetUtils.HAPROXY_STATS_PORT) {
+            logger.debug("Can't create LB on port 8081, haproxy is listening for  LB stats on this port");
+            return false;
+        }
+
+        for (final LbStickinessPolicy stickinessPolicy : rule.getStickinessPolicies()) {
+            final List<Pair<String, String>> paramsList = stickinessPolicy.getParams();
+
+            if (StickinessMethodType.LBCookieBased.getName().equalsIgnoreCase(stickinessPolicy.getMethodName())) {
+
+            } else if (StickinessMethodType.SourceBased.getName().equalsIgnoreCase(stickinessPolicy.getMethodName())) {
+                String tablesize = "200k"; // optional
+                String expire = "30m"; // optional
+
+                /* overwrite default values with the stick parameters */
+                for (final Pair<String, String> paramKV : paramsList) {
+                    final String key = paramKV.first();
+                    final String value = paramKV.second();
+                    if ("tablesize".equalsIgnoreCase(key)) {
+                        tablesize = value;
+                    }
+                    if ("expire".equalsIgnoreCase(key)) {
+                        expire = value;
+                    }
+                }
+                if (expire != null && !containsOnlyNumbers(expire, timeEndChar)) {
+                    throw new InvalidParameterValueException("Failed LB in validation rule id: " + rule.getId() + " Cause: expire is not in timeformat: " + expire);
+                }
+                if (tablesize != null && !containsOnlyNumbers(tablesize, "kmg")) {
+                    throw new InvalidParameterValueException("Failed LB in validation rule id: " + rule.getId() + " Cause: tablesize is not in size format: " + tablesize);
+
+                }
+            } else if (StickinessMethodType.AppCookieBased.getName().equalsIgnoreCase(stickinessPolicy.getMethodName())) {
+                String length = null; // optional
+                String holdTime = null; // optional
+
+                for (final Pair<String, String> paramKV : paramsList) {
+                    final String key = paramKV.first();
+                    final String value = paramKV.second();
+                    if ("length".equalsIgnoreCase(key)) {
+                        length = value;
+                    }
+                    if ("holdtime".equalsIgnoreCase(key)) {
+                        holdTime = value;
+                    }
+                }
+
+                if (length != null && !containsOnlyNumbers(length, null)) {
+                    throw new InvalidParameterValueException("Failed LB in validation rule id: " + rule.getId() + " Cause: length is not a number: " + length);
+                }
+                if (holdTime != null && !containsOnlyNumbers(holdTime, timeEndChar) && !containsOnlyNumbers(holdTime, null)) {
+                    throw new InvalidParameterValueException("Failed LB in validation rule id: " + rule.getId() + " Cause: holdtime is not in timeformat: " + holdTime);
+                }
+            }
+        }
+        return true;
+    }
+
+    /**
+     * This function detects numbers like 12 ,32h ,42m .. etc,. 1) plain number
+     * like 12 2) time or tablesize like 12h, 34m, 45k, 54m , here last
+     * character is non-digit but from known characters .
+     */
+    private static boolean containsOnlyNumbers(final String str, final String endChar) {
+        if (str == null) {
+            return false;
+        }
+
+        String number = str;
+        if (endChar != null) {
+            boolean matchedEndChar = false;
+            if (str.length() < 2) {
+                return false; // at least one numeric and one char. example:
+            }
+            // 3h
+            final char strEnd = str.toCharArray()[str.length() - 1];
+            for (final char c : endChar.toCharArray()) {
+                if (strEnd == c) {
+                    number = str.substring(0, str.length() - 1);
+                    matchedEndChar = true;
+                    break;
+                }
+            }
+            if (!matchedEndChar) {
+                return false;
+            }
+        }
+        try {
+            Integer.parseInt(number);
+        } catch (final NumberFormatException e) {
+            return false;
+        }
+        return true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/network/element/VirtualRouterElement.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/VirtualRouterElement.java b/server/src/com/cloud/network/element/VirtualRouterElement.java
index 1a340fa..feb4cc7 100644
--- a/server/src/com/cloud/network/element/VirtualRouterElement.java
+++ b/server/src/com/cloud/network/element/VirtualRouterElement.java
@@ -33,7 +33,6 @@ import org.apache.cloudstack.api.command.admin.router.ListVirtualRouterElementsC
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.network.topology.NetworkTopology;
 import org.apache.cloudstack.network.topology.NetworkTopologyContext;
-import org.apache.log4j.Logger;
 import org.cloud.network.router.deployment.RouterDeploymentDefinition;
 import org.cloud.network.router.deployment.RouterDeploymentDefinitionBuilder;
 
@@ -73,7 +72,6 @@ import com.cloud.network.dao.NetworkDao;
 import com.cloud.network.dao.OvsProviderDao;
 import com.cloud.network.dao.VirtualRouterProviderDao;
 import com.cloud.network.lb.LoadBalancingRule;
-import com.cloud.network.lb.LoadBalancingRule.LbStickinessPolicy;
 import com.cloud.network.lb.LoadBalancingRulesManager;
 import com.cloud.network.router.VirtualRouter;
 import com.cloud.network.router.VirtualRouter.Role;
@@ -90,13 +88,11 @@ import com.cloud.offerings.NetworkOfferingVO;
 import com.cloud.offerings.dao.NetworkOfferingDao;
 import com.cloud.user.Account;
 import com.cloud.user.AccountManager;
-import com.cloud.utils.Pair;
 import com.cloud.utils.component.AdapterBase;
 import com.cloud.utils.crypt.DBEncryptionUtil;
 import com.cloud.utils.db.QueryBuilder;
 import com.cloud.utils.db.SearchCriteria.Op;
 import com.cloud.utils.exception.CloudRuntimeException;
-import com.cloud.utils.net.NetUtils;
 import com.cloud.vm.DomainRouterVO;
 import com.cloud.vm.NicProfile;
 import com.cloud.vm.ReservationContext;
@@ -114,7 +110,6 @@ import com.google.gson.Gson;
 public class VirtualRouterElement extends AdapterBase implements VirtualRouterElementService, DhcpServiceProvider, UserDataServiceProvider, SourceNatServiceProvider,
 StaticNatServiceProvider, FirewallServiceProvider, LoadBalancingServiceProvider, PortForwardingServiceProvider, RemoteAccessVPNServiceProvider, IpDeployer,
 NetworkMigrationResponder, AggregatedCommandExecutor {
-    private static final Logger s_logger = Logger.getLogger(VirtualRouterElement.class);
     public static final AutoScaleCounterType AutoScaleCounterCpu = new AutoScaleCounterType("cpu");
     public static final AutoScaleCounterType AutoScaleCounterMemory = new AutoScaleCounterType("memory");
     protected static final Map<Service, Map<Capability, String>> capabilities = setCapabilities();
@@ -164,6 +159,9 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
     @Inject
     protected RouterDeploymentDefinitionBuilder routerDeploymentDefinitionBuilder;
 
+    @Inject
+    private HAProxyLBRule haProxyLBRule;
+
     protected boolean canHandle(final Network network, final Service service) {
         final Long physicalNetworkId = _networkMdl.getPhysicalNetworkId(network);
         if (physicalNetworkId == null) {
@@ -180,12 +178,12 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
 
         if (service == null) {
             if (!_networkMdl.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 (!_networkMdl.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;
             }
         }
@@ -265,7 +263,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         if (canHandle(network, Service.Firewall)) {
             final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
             if (routers == null || routers.isEmpty()) {
-                s_logger.debug("Virtual router elemnt doesn't need to apply firewall rules on the backend; virtual " + "router doesn't exist in the network " + network.getId());
+                logger.debug("Virtual router elemnt doesn't need to apply firewall rules on the backend; virtual " + "router doesn't exist in the network " + network.getId());
                 return true;
             }
 
@@ -291,104 +289,6 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         }
     }
 
-    /*
-     * This function detects numbers like 12 ,32h ,42m .. etc,. 1) plain number
-     * like 12 2) time or tablesize like 12h, 34m, 45k, 54m , here last
-     * character is non-digit but from known characters .
-     */
-    private static boolean containsOnlyNumbers(final String str, final String endChar) {
-        if (str == null) {
-            return false;
-        }
-
-        String number = str;
-        if (endChar != null) {
-            boolean matchedEndChar = false;
-            if (str.length() < 2) {
-                return false; // at least one numeric and one char. example:
-            }
-            // 3h
-            final char strEnd = str.toCharArray()[str.length() - 1];
-            for (final char c : endChar.toCharArray()) {
-                if (strEnd == c) {
-                    number = str.substring(0, str.length() - 1);
-                    matchedEndChar = true;
-                    break;
-                }
-            }
-            if (!matchedEndChar) {
-                return false;
-            }
-        }
-        try {
-            Integer.parseInt(number);
-        } catch (final NumberFormatException e) {
-            return false;
-        }
-        return true;
-    }
-
-    public static boolean validateHAProxyLBRule(final LoadBalancingRule rule) {
-        final String timeEndChar = "dhms";
-
-        if (rule.getSourcePortStart() == NetUtils.HAPROXY_STATS_PORT) {
-            s_logger.debug("Can't create LB on port 8081, haproxy is listening for  LB stats on this port");
-            return false;
-        }
-
-        for (final LbStickinessPolicy stickinessPolicy : rule.getStickinessPolicies()) {
-            final List<Pair<String, String>> paramsList = stickinessPolicy.getParams();
-
-            if (StickinessMethodType.LBCookieBased.getName().equalsIgnoreCase(stickinessPolicy.getMethodName())) {
-
-            } else if (StickinessMethodType.SourceBased.getName().equalsIgnoreCase(stickinessPolicy.getMethodName())) {
-                String tablesize = "200k"; // optional
-                String expire = "30m"; // optional
-
-                /* overwrite default values with the stick parameters */
-                for (final Pair<String, String> paramKV : paramsList) {
-                    final String key = paramKV.first();
-                    final String value = paramKV.second();
-                    if ("tablesize".equalsIgnoreCase(key)) {
-                        tablesize = value;
-                    }
-                    if ("expire".equalsIgnoreCase(key)) {
-                        expire = value;
-                    }
-                }
-                if (expire != null && !containsOnlyNumbers(expire, timeEndChar)) {
-                    throw new InvalidParameterValueException("Failed LB in validation rule id: " + rule.getId() + " Cause: expire is not in timeformat: " + expire);
-                }
-                if (tablesize != null && !containsOnlyNumbers(tablesize, "kmg")) {
-                    throw new InvalidParameterValueException("Failed LB in validation rule id: " + rule.getId() + " Cause: tablesize is not in size format: " + tablesize);
-
-                }
-            } else if (StickinessMethodType.AppCookieBased.getName().equalsIgnoreCase(stickinessPolicy.getMethodName())) {
-                String length = null; // optional
-                String holdTime = null; // optional
-
-                for (final Pair<String, String> paramKV : paramsList) {
-                    final String key = paramKV.first();
-                    final String value = paramKV.second();
-                    if ("length".equalsIgnoreCase(key)) {
-                        length = value;
-                    }
-                    if ("holdtime".equalsIgnoreCase(key)) {
-                        holdTime = value;
-                    }
-                }
-
-                if (length != null && !containsOnlyNumbers(length, null)) {
-                    throw new InvalidParameterValueException("Failed LB in validation rule id: " + rule.getId() + " Cause: length is not a number: " + length);
-                }
-                if (holdTime != null && !containsOnlyNumbers(holdTime, timeEndChar) && !containsOnlyNumbers(holdTime, null)) {
-                    throw new InvalidParameterValueException("Failed LB in validation rule id: " + rule.getId() + " Cause: holdtime is not in timeformat: " + holdTime);
-                }
-            }
-        }
-        return true;
-    }
-
     @Override
     public boolean validateLBRule(final Network network, final LoadBalancingRule rule) {
         final List<LoadBalancingRule> rules = new ArrayList<LoadBalancingRule>();
@@ -398,7 +298,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
             if (routers == null || routers.isEmpty()) {
                 return true;
             }
-            return validateHAProxyLBRule(rule);
+            return haProxyLBRule.validateHAProxyLBRule(rule);
         }
         return true;
     }
@@ -412,7 +312,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
 
             final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
             if (routers == null || routers.isEmpty()) {
-                s_logger.debug("Virtual router elemnt doesn't need to apply lb rules on the backend; virtual " + "router doesn't exist in the network " + network.getId());
+                logger.debug("Virtual router elemnt doesn't need to apply lb rules on the backend; virtual " + "router doesn't exist in the network " + network.getId());
                 return true;
             }
 
@@ -439,7 +339,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         if (canHandle(network, Service.Vpn)) {
             final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
             if (routers == null || routers.isEmpty()) {
-                s_logger.debug("Virtual router elemnt doesn't need to apply vpn users on the backend; virtual router" + " doesn't exist in the network " + network.getId());
+                logger.debug("Virtual router elemnt doesn't need to apply vpn users on the backend; virtual router" + " doesn't exist in the network " + network.getId());
                 return null;
             }
 
@@ -448,7 +348,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
 
             return networkTopology.applyVpnUsers(network, users, routers);
         } else {
-            s_logger.debug("Element " + getName() + " doesn't handle applyVpnUsers command");
+            logger.debug("Element " + getName() + " doesn't handle applyVpnUsers command");
             return null;
         }
     }
@@ -463,12 +363,12 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         if (canHandle(network, Service.Vpn)) {
             final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
             if (routers == null || routers.isEmpty()) {
-                s_logger.debug("Virtual router elemnt doesn't need stop vpn on the backend; virtual router doesn't" + " exist in the network " + network.getId());
+                logger.debug("Virtual router elemnt doesn't need stop vpn on the backend; virtual router doesn't" + " exist in the network " + network.getId());
                 return true;
             }
             return _routerMgr.startRemoteAccessVpn(network, vpn, routers);
         } else {
-            s_logger.debug("Element " + getName() + " doesn't handle createVpn command");
+            logger.debug("Element " + getName() + " doesn't handle createVpn command");
             return false;
         }
     }
@@ -483,12 +383,12 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         if (canHandle(network, Service.Vpn)) {
             final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
             if (routers == null || routers.isEmpty()) {
-                s_logger.debug("Virtual router elemnt doesn't need stop vpn on the backend; virtual router doesn't " + "exist in the network " + network.getId());
+                logger.debug("Virtual router elemnt doesn't need stop vpn on the backend; virtual router doesn't " + "exist in the network " + network.getId());
                 return true;
             }
             return _routerMgr.deleteRemoteAccessVpn(network, vpn, routers);
         } else {
-            s_logger.debug("Element " + getName() + " doesn't handle removeVpn command");
+            logger.debug("Element " + getName() + " doesn't handle removeVpn command");
             return false;
         }
     }
@@ -505,7 +405,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         if (canHandle) {
             final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
             if (routers == null || routers.isEmpty()) {
-                s_logger.debug("Virtual router elemnt doesn't need to associate ip addresses on the backend; virtual " + "router doesn't exist in the network " + network.getId());
+                logger.debug("Virtual router elemnt doesn't need to associate ip addresses on the backend; virtual " + "router doesn't exist in the network " + network.getId());
                 return true;
             }
 
@@ -662,7 +562,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         if (canHandle(network, Service.StaticNat)) {
             final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
             if (routers == null || routers.isEmpty()) {
-                s_logger.debug("Virtual router elemnt doesn't need to apply static nat on the backend; virtual " + "router doesn't exist in the network " + network.getId());
+                logger.debug("Virtual router elemnt doesn't need to apply static nat on the backend; virtual " + "router doesn't exist in the network " + network.getId());
                 return true;
             }
 
@@ -686,11 +586,11 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
             result = result && _routerMgr.stop(router, false, context.getCaller(), context.getAccount()) != null;
             if (cleanup) {
                 if (!result) {
-                    s_logger.warn("Failed to stop virtual router element " + router + ", but would try to process clean up anyway.");
+                    logger.warn("Failed to stop virtual router element " + router + ", but would try to process clean up anyway.");
                 }
                 result = _routerMgr.destroyRouter(router.getId(), context.getAccount(), context.getCaller().getId()) != null;
                 if (!result) {
-                    s_logger.warn("Failed to clean up virtual router element " + router);
+                    logger.warn("Failed to clean up virtual router element " + router);
                 }
             }
         }
@@ -722,7 +622,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         }
         final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
         if (routers == null || routers.isEmpty()) {
-            s_logger.debug("Can't find virtual router element in network " + network.getId());
+            logger.debug("Can't find virtual router element in network " + network.getId());
             return true;
         }
 
@@ -759,7 +659,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         }
         final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
         if (routers == null || routers.isEmpty()) {
-            s_logger.debug("Can't find virtual router element in network " + network.getId());
+            logger.debug("Can't find virtual router element in network " + network.getId());
             return true;
         }
 
@@ -778,7 +678,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         }
         final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
         if (routers == null || routers.isEmpty()) {
-            s_logger.debug("Can't find virtual router element in network " + network.getId());
+            logger.debug("Can't find virtual router element in network " + network.getId());
             return true;
         }
 
@@ -803,7 +703,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
     public VirtualRouterProvider configure(final ConfigureVirtualRouterElementCmd cmd) {
         final VirtualRouterProviderVO element = _vrProviderDao.findById(cmd.getId());
         if (element == null || !(element.getType() == Type.VirtualRouter || element.getType() == Type.VPCVirtualRouter)) {
-            s_logger.debug("Can't find Virtual Router element with network service provider id " + cmd.getId());
+            logger.debug("Can't find Virtual Router element with network service provider id " + cmd.getId());
             return null;
         }
 
@@ -817,7 +717,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
     public OvsProvider configure(final ConfigureOvsElementCmd cmd) {
         final OvsProviderVO element = _ovsProviderDao.findById(cmd.getId());
         if (element == null) {
-            s_logger.debug("Can't find Ovs element with network service provider id " + cmd.getId());
+            logger.debug("Can't find Ovs element with network service provider id " + cmd.getId());
             return null;
         }
 
@@ -834,7 +734,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         }
         VirtualRouterProviderVO element = _vrProviderDao.findByNspIdAndType(nspId, providerType);
         if (element != null) {
-            s_logger.debug("There is already a virtual router element with service provider id " + nspId);
+            logger.debug("There is already a virtual router element with service provider id " + nspId);
             return null;
         }
         element = new VirtualRouterProviderVO(nspId, providerType);
@@ -847,7 +747,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
         if (canHandle(network, Service.PortForwarding)) {
             final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
             if (routers == null || routers.isEmpty()) {
-                s_logger.debug("Virtual router elemnt doesn't need to apply firewall rules on the backend; virtual " + "router doesn't exist in the network " + network.getId());
+                logger.debug("Virtual router elemnt doesn't need to apply firewall rules on the backend; virtual " + "router doesn't exist in the network " + network.getId());
                 return true;
             }
 
@@ -951,7 +851,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
             try {
                 return _routerMgr.removeDhcpSupportForSubnet(network, routers);
             } catch (final ResourceUnavailableException e) {
-                s_logger.debug("Router resource unavailable ");
+                logger.debug("Router resource unavailable ");
             }
         }
         return false;
@@ -990,7 +890,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
             }
 
             if (network.getIp6Gateway() != null) {
-                s_logger.info("Skip password and userdata service setup for IPv6 VM");
+                logger.info("Skip password and userdata service setup for IPv6 VM");
                 return true;
             }
 
@@ -1117,7 +1017,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
             if (schemeCaps != null) {
                 for (final LoadBalancingRule rule : rules) {
                     if (!schemeCaps.contains(rule.getScheme().toString())) {
-                        s_logger.debug("Scheme " + rules.get(0).getScheme() + " is not supported by the provider " + getName());
+                        logger.debug("Scheme " + rules.get(0).getScheme() + " is not supported by the provider " + getName());
                         return false;
                     }
                 }
@@ -1141,7 +1041,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
             try {
                 networkTopology.setupDhcpForPvlan(false, router, router.getHostId(), nic);
             } catch (final ResourceUnavailableException e) {
-                s_logger.warn("Timed Out", e);
+                logger.warn("Timed Out", e);
             }
         } else if (vm.getType() == VirtualMachine.Type.User) {
             assert vm instanceof UserVmVO;
@@ -1166,7 +1066,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
             try {
                 networkTopology.setupDhcpForPvlan(true, router, router.getHostId(), nic);
             } catch (final ResourceUnavailableException e) {
-                s_logger.warn("Timed Out", e);
+                logger.warn("Timed Out", e);
             }
         } else if (vm.getType() == VirtualMachine.Type.User) {
             assert vm instanceof UserVmVO;
@@ -1190,7 +1090,7 @@ NetworkMigrationResponder, AggregatedCommandExecutor {
             try {
                 networkTopology.setupDhcpForPvlan(true, router, router.getHostId(), nic);
             } catch (final ResourceUnavailableException e) {
-                s_logger.warn("Timed Out", e);
+                logger.warn("Timed Out", e);
             }
         } else if (vm.getType() == VirtualMachine.Type.User) {
             assert vm instanceof UserVmVO;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/server/src/com/cloud/network/element/VpcVirtualRouterElement.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/element/VpcVirtualRouterElement.java b/server/src/com/cloud/network/element/VpcVirtualRouterElement.java
index 078eab3..9e5d81b 100644
--- a/server/src/com/cloud/network/element/VpcVirtualRouterElement.java
+++ b/server/src/com/cloud/network/element/VpcVirtualRouterElement.java
@@ -25,7 +25,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.cloudstack.network.topology.NetworkTopology;
-import org.apache.log4j.Logger;
 import org.cloud.network.router.deployment.RouterDeploymentDefinition;
 import org.cloud.network.router.deployment.RouterDeploymentDefinitionBuilder;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -83,7 +82,6 @@ import com.cloud.vm.VirtualMachineProfile;
         NetworkACLServiceProvider.class })
 public class VpcVirtualRouterElement extends VirtualRouterElement implements VpcProvider, Site2SiteVpnServiceProvider, NetworkACLServiceProvider {
 
-    private static final Logger s_logger = Logger.getLogger(VpcVirtualRouterElement.class);
 
     private static final Map<Service, Map<Capability, String>> capabilities = setCapabilities();
 
@@ -136,12 +134,12 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
 
         if (service == null) {
             if (!_networkMdl.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 (!_networkMdl.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;
             }
         }
@@ -184,13 +182,13 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
 
         final Long vpcId = network.getVpcId();
         if (vpcId == null) {
-            s_logger.trace("Network " + network + " is not associated with any VPC");
+            logger.trace("Network " + network + " is not associated with any VPC");
             return false;
         }
 
         final Vpc vpc = _vpcMgr.getActiveVpc(vpcId);
         if (vpc == null) {
-            s_logger.warn("Unable to find Enabled VPC by id " + vpcId);
+            logger.warn("Unable to find Enabled VPC by id " + vpcId);
             return false;
         }
 
@@ -219,7 +217,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
     protected void configureGuestNetwork(final Network network, final List<DomainRouterVO> routers )
             throws ConcurrentOperationException, InsufficientCapacityException, ResourceUnavailableException {
 
-        s_logger.info("Adding VPC routers to Guest Network: " + routers.size() + " to be added!");
+        logger.info("Adding VPC routers to Guest Network: " + routers.size() + " to be added!");
 
         for (final DomainRouterVO router : routers) {
             if (!_networkMdl.isVmPartOfNetwork(router.getId(), network.getId())) {
@@ -228,9 +226,9 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
                     paramsForRouter.put(VirtualMachineProfile.Param.ReProgramGuestNetworks, true);
                 }
                 if (!_vpcRouterMgr.addVpcRouterToGuestNetwork(router, network, paramsForRouter)) {
-                    s_logger.error("Failed to add VPC router " + router + " to guest network " + network);
+                    logger.error("Failed to add VPC router " + router + " to guest network " + network);
                 } else {
-                    s_logger.debug("Successfully added VPC router " + router + " to guest network " + network);
+                    logger.debug("Successfully added VPC router " + router + " to guest network " + network);
                 }
             }
         }
@@ -242,13 +240,13 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
 
         final Long vpcId = network.getVpcId();
         if (vpcId == null) {
-            s_logger.trace("Network " + network + " is not associated with any VPC");
+            logger.trace("Network " + network + " is not associated with any VPC");
             return false;
         }
 
         final Vpc vpc = _vpcMgr.getActiveVpc(vpcId);
         if (vpc == null) {
-            s_logger.warn("Unable to find Enabled VPC by id " + vpcId);
+            logger.warn("Unable to find Enabled VPC by id " + vpcId);
             return false;
         }
 
@@ -281,7 +279,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
         boolean success = true;
         final Long vpcId = network.getVpcId();
         if (vpcId == null) {
-            s_logger.debug("Network " + network + " doesn't belong to any vpc, so skipping unplug nic part");
+            logger.debug("Network " + network + " doesn't belong to any vpc, so skipping unplug nic part");
             return success;
         }
 
@@ -289,15 +287,15 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
         for (final VirtualRouter router : routers) {
             // 1) Check if router is already a part of the network
             if (!_networkMdl.isVmPartOfNetwork(router.getId(), network.getId())) {
-                s_logger.debug("Router " + router + " is not a part the network " + network);
+                logger.debug("Router " + router + " is not a part the network " + network);
                 continue;
             }
             // 2) Call unplugNics in the network service
             success = success && _vpcRouterMgr.removeVpcRouterFromGuestNetwork(router, network);
             if (!success) {
-                s_logger.warn("Failed to unplug nic in network " + network + " for virtual router " + router);
+                logger.warn("Failed to unplug nic in network " + network + " for virtual router " + router);
             } else {
-                s_logger.debug("Successfully unplugged nic in network " + network + " for virtual router " + router);
+                logger.debug("Successfully unplugged nic in network " + network + " for virtual router " + router);
             }
         }
 
@@ -309,7 +307,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
         boolean success = true;
         final Long vpcId = config.getVpcId();
         if (vpcId == null) {
-            s_logger.debug("Network " + config + " doesn't belong to any vpc, so skipping unplug nic part");
+            logger.debug("Network " + config + " doesn't belong to any vpc, so skipping unplug nic part");
             return success;
         }
 
@@ -317,15 +315,15 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
         for (final VirtualRouter router : routers) {
             // 1) Check if router is already a part of the network
             if (!_networkMdl.isVmPartOfNetwork(router.getId(), config.getId())) {
-                s_logger.debug("Router " + router + " is not a part the network " + config);
+                logger.debug("Router " + router + " is not a part the network " + config);
                 continue;
             }
             // 2) Call unplugNics in the network service
             success = success && _vpcRouterMgr.removeVpcRouterFromGuestNetwork(router, config);
             if (!success) {
-                s_logger.warn("Failed to unplug nic in network " + config + " for virtual router " + router);
+                logger.warn("Failed to unplug nic in network " + config + " for virtual router " + router);
             } else {
-                s_logger.debug("Successfully unplugged nic in network " + config + " for virtual router " + router);
+                logger.debug("Successfully unplugged nic in network " + config + " for virtual router " + router);
             }
         }
 
@@ -349,13 +347,13 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
         //For the 2nd time it returns the VPC routers.
         final Long vpcId = network.getVpcId();
         if (vpcId == null) {
-            s_logger.error("Network " + network + " is not associated with any VPC");
+            logger.error("Network " + network + " is not associated with any VPC");
             return routers;
         }
 
         final Vpc vpc = _vpcMgr.getActiveVpc(vpcId);
         if (vpc == null) {
-            s_logger.warn("Unable to find Enabled VPC by id " + vpcId);
+            logger.warn("Unable to find Enabled VPC by id " + vpcId);
             return routers;
         }
 
@@ -369,11 +367,11 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
         try {
             routers = routerDeploymentDefinition.deployVirtualRouter();
         } catch (final ConcurrentOperationException e) {
-            s_logger.error("Error occurred when loading routers from routerDeploymentDefinition.deployVirtualRouter()!", e);
+            logger.error("Error occurred when loading routers from routerDeploymentDefinition.deployVirtualRouter()!", e);
         } catch (final InsufficientCapacityException e) {
-            s_logger.error("Error occurred when loading routers from routerDeploymentDefinition.deployVirtualRouter()!", e);
+            logger.error("Error occurred when loading routers from routerDeploymentDefinition.deployVirtualRouter()!", e);
         } catch (final ResourceUnavailableException e) {
-            s_logger.error("Error occurred when loading routers from routerDeploymentDefinition.deployVirtualRouter()!", e);
+            logger.error("Error occurred when loading routers from routerDeploymentDefinition.deployVirtualRouter()!", e);
         }
 
         return routers;
@@ -413,17 +411,17 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
     @Override
     public boolean createPrivateGateway(final PrivateGateway gateway) throws ConcurrentOperationException, ResourceUnavailableException {
         if (gateway.getType() != VpcGateway.Type.Private) {
-            s_logger.warn("Type of vpc gateway is not " + VpcGateway.Type.Private);
+            logger.warn("Type of vpc gateway is not " + VpcGateway.Type.Private);
             return false;
         }
 
         final List<DomainRouterVO> routers = _vpcRouterMgr.getVpcRouters(gateway.getVpcId());
         if (routers == null || routers.isEmpty()) {
-            s_logger.debug(getName() + " element doesn't need to create Private gateway on the backend; VPC virtual " + "router doesn't exist in the vpc id=" + gateway.getVpcId());
+            logger.debug(getName() + " element doesn't need to create Private gateway on the backend; VPC virtual " + "router doesn't exist in the vpc id=" + gateway.getVpcId());
             return true;
         }
 
-        s_logger.info("Adding VPC routers to Guest Network: " + routers.size() + " to be added!");
+        logger.info("Adding VPC routers to Guest Network: " + routers.size() + " to be added!");
 
         final DataCenterVO dcVO = _dcDao.findById(gateway.getZoneId());
         final NetworkTopology networkTopology = networkTopologyContext.retrieveNetworkTopology(dcVO);
@@ -433,15 +431,15 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
                 try {
                     final List<NetworkACLItemVO> rules = _networkACLItemDao.listByACL(gateway.getNetworkACLId());
                     if (!applyACLItemsToPrivateGw(gateway, rules)) {
-                        s_logger.debug("Failed to apply network acl id  " + gateway.getNetworkACLId() + "  on gateway ");
+                        logger.debug("Failed to apply network acl id  " + gateway.getNetworkACLId() + "  on gateway ");
                         return false;
                     }
                 } catch (final Exception ex) {
-                    s_logger.debug("Failed to apply network acl id  " + gateway.getNetworkACLId() + "  on gateway ");
+                    logger.debug("Failed to apply network acl id  " + gateway.getNetworkACLId() + "  on gateway ");
                     return false;
                 }
             } else {
-                s_logger.debug("Failed to setup private gateway  " + gateway);
+                logger.debug("Failed to setup private gateway  " + gateway);
                 return false;
             }
         }
@@ -452,17 +450,17 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
     @Override
     public boolean deletePrivateGateway(final PrivateGateway gateway) throws ConcurrentOperationException, ResourceUnavailableException {
         if (gateway.getType() != VpcGateway.Type.Private) {
-            s_logger.warn("Type of vpc gateway is not " + VpcGateway.Type.Private);
+            logger.warn("Type of vpc gateway is not " + VpcGateway.Type.Private);
             return false;
         }
 
         final List<DomainRouterVO> routers = _vpcRouterMgr.getVpcRouters(gateway.getVpcId());
         if (routers == null || routers.isEmpty()) {
-            s_logger.debug(getName() + " element doesn't need to delete Private gateway on the backend; VPC virtual " + "router doesn't exist in the vpc id=" + gateway.getVpcId());
+            logger.debug(getName() + " element doesn't need to delete Private gateway on the backend; VPC virtual " + "router doesn't exist in the vpc id=" + gateway.getVpcId());
             return true;
         }
 
-        s_logger.info("Adding VPC routers to Guest Network: " + routers.size() + " to be added!");
+        logger.info("Adding VPC routers to Guest Network: " + routers.size() + " to be added!");
 
         int result = 0;
         for (final DomainRouterVO domainRouterVO : routers) {
@@ -486,7 +484,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
         if (canHandle) {
             final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
             if (routers == null || routers.isEmpty()) {
-                s_logger.debug(getName() + " element doesn't need to associate ip addresses on the backend; VPC virtual " + "router doesn't exist in the network "
+                logger.debug(getName() + " element doesn't need to associate ip addresses on the backend; VPC virtual " + "router doesn't exist in the network "
                         + network.getId());
                 return true;
             }
@@ -505,7 +503,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
         if (canHandle(network, Service.NetworkACL)) {
             final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(network.getId(), Role.VIRTUAL_ROUTER);
             if (routers == null || routers.isEmpty()) {
-                s_logger.debug("Virtual router elemnt doesn't need to apply firewall rules on the backend; virtual " + "router doesn't exist in the network " + network.getId());
+                logger.debug("Virtual router elemnt doesn't need to apply firewall rules on the backend; virtual " + "router doesn't exist in the network " + network.getId());
                 return true;
             }
 
@@ -519,7 +517,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
                     return true;
                 }
             } catch (final Exception ex) {
-                s_logger.debug("Failed to apply network acl in network " + network.getId());
+                logger.debug("Failed to apply network acl in network " + network.getId());
                 return false;
             }
         } else {
@@ -536,7 +534,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
     public boolean applyStaticRoutes(final Vpc vpc, final List<StaticRouteProfile> routes) throws ResourceUnavailableException {
         final List<DomainRouterVO> routers = _routerDao.listByVpcId(vpc.getId());
         if (routers == null || routers.isEmpty()) {
-            s_logger.debug("Virtual router elemnt doesn't need to static routes on the backend; virtual " + "router doesn't exist in the vpc " + vpc);
+            logger.debug("Virtual router elemnt doesn't need to static routes on the backend; virtual " + "router doesn't exist in the vpc " + vpc);
             return true;
         }
 
@@ -546,7 +544,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
         if (!networkTopology.applyStaticRoutes(routes, routers)) {
             throw new CloudRuntimeException("Failed to apply static routes in vpc " + vpc);
         } else {
-            s_logger.debug("Applied static routes on vpc " + vpc);
+            logger.debug("Applied static routes on vpc " + vpc);
             return true;
         }
     }
@@ -558,7 +556,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
 
         final List<DomainRouterVO> routers = _vpcRouterMgr.getVpcRouters(gateway.getVpcId());
         if (routers == null || routers.isEmpty()) {
-            s_logger.debug("Virtual router element doesn't need to apply network acl rules on the backend; virtual " + "router doesn't exist in the network " + network.getId());
+            logger.debug("Virtual router element doesn't need to apply network acl rules on the backend; virtual " + "router doesn't exist in the network " + network.getId());
             return true;
         }
 
@@ -579,7 +577,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
 
         final Map<Capability, String> vpnCapabilities = capabilities.get(Service.Vpn);
         if (!vpnCapabilities.get(Capability.VpnTypes).contains("s2svpn")) {
-            s_logger.error("try to start site 2 site vpn on unsupported network element?");
+            logger.error("try to start site 2 site vpn on unsupported network element?");
             return false;
         }
 
@@ -610,7 +608,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
 
         final Map<Capability, String> vpnCapabilities = capabilities.get(Service.Vpn);
         if (!vpnCapabilities.get(Capability.VpnTypes).contains("s2svpn")) {
-            s_logger.error("try to stop site 2 site vpn on unsupported network element?");
+            logger.error("try to stop site 2 site vpn on unsupported network element?");
             return false;
         }
 
@@ -643,7 +641,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
 
         final List<DomainRouterVO> routers = _vpcRouterMgr.getVpcRouters(vpn.getVpcId());
         if (routers == null) {
-            s_logger.debug("Cannot apply vpn users on the backend; virtual router doesn't exist in the network " + vpn.getVpcId());
+            logger.debug("Cannot apply vpn users on the backend; virtual router doesn't exist in the network " + vpn.getVpcId());
             return null;
         }
 
@@ -666,7 +664,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
 
         final List<DomainRouterVO> routers = _vpcRouterMgr.getVpcRouters(vpn.getVpcId());
         if (routers == null) {
-            s_logger.debug("Cannot apply vpn users on the backend; virtual router doesn't exist in the network " + vpn.getVpcId());
+            logger.debug("Cannot apply vpn users on the backend; virtual router doesn't exist in the network " + vpn.getVpcId());
             return false;
         }
 
@@ -685,7 +683,7 @@ public class VpcVirtualRouterElement extends VirtualRouterElement implements Vpc
 
         final List<DomainRouterVO> routers = _vpcRouterMgr.getVpcRouters(vpn.getVpcId());
         if (routers == null) {
-            s_logger.debug("Cannot apply vpn users on the backend; virtual router doesn't exist in the network " + vpn.getVpcId());
+            logger.debug("Cannot apply vpn users on the backend; virtual router doesn't exist in the network " + vpn.getVpcId());
             return false;
         }
 


Mime
View raw message