cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [31/36] git commit: updated refs/heads/master to cd7218e
Date Sat, 29 Aug 2015 20:06:28 GMT
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
index d407bb1..f793efb 100644
--- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java
@@ -30,7 +30,6 @@ import java.util.concurrent.ExecutionException;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
 
 import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService;
 import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo;
@@ -131,7 +130,6 @@ import com.cloud.vm.VmWorkTakeVolumeSnapshot;
 import com.cloud.vm.dao.UserVmDao;
 
 public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrationService, Configurable {
-    private static final Logger s_logger = Logger.getLogger(VolumeOrchestrator.class);
 
     @Inject
     EntityManager _entityMgr;
@@ -343,8 +341,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
 
             if (pool == null) {
                 //pool could not be found in the VM's pod/cluster.
-                if (s_logger.isDebugEnabled()) {
-                    s_logger.debug("Could not find any storage pool to create Volume in the pod/cluster of the provided VM " + vm.getUuid());
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Could not find any storage pool to create Volume in the pod/cluster of the provided VM " + vm.getUuid());
                 }
                 StringBuilder addDetails = new StringBuilder(msg);
                 addDetails.append(", Could not find any storage pool to create Volume in the pod/cluster of the VM ");
@@ -361,8 +359,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                 }
 
                 if (pool != null) {
-                    if (s_logger.isDebugEnabled()) {
-                        s_logger.debug("Found a suitable pool for create volume: " + pool.getId());
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("Found a suitable pool for create volume: " + pool.getId());
                     }
                     break;
                 }
@@ -370,7 +368,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         }
 
         if (pool == null) {
-            s_logger.info(msg);
+            logger.info(msg);
             throw new StorageUnavailableException(msg, -1);
         }
 
@@ -389,7 +387,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                 _snapshotSrv.syncVolumeSnapshotsToRegionStore(snapVolId, snapStore);
             } catch (Exception ex) {
                 // log but ignore the sync error to avoid any potential S3 down issue, it should be sync next time
-                s_logger.warn(ex.getMessage(), ex);
+                logger.warn(ex.getMessage(), ex);
             }
         }
 
@@ -398,15 +396,15 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         try {
             VolumeApiResult result = future.get();
             if (result.isFailed()) {
-                s_logger.debug("Failed to create volume from snapshot:" + result.getResult());
+                logger.debug("Failed to create volume from snapshot:" + result.getResult());
                 throw new CloudRuntimeException("Failed to create volume from snapshot:" + result.getResult());
             }
             return result.getVolume();
         } catch (InterruptedException e) {
-            s_logger.debug("Failed to create volume from snapshot", e);
+            logger.debug("Failed to create volume from snapshot", e);
             throw new CloudRuntimeException("Failed to create volume from snapshot", e);
         } catch (ExecutionException e) {
-            s_logger.debug("Failed to create volume from snapshot", e);
+            logger.debug("Failed to create volume from snapshot", e);
             throw new CloudRuntimeException("Failed to create volume from snapshot", e);
         }
 
@@ -466,15 +464,15 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         try {
             VolumeApiResult result = future.get();
             if (result.isFailed()) {
-                s_logger.debug("copy volume failed: " + result.getResult());
+                logger.debug("copy volume failed: " + result.getResult());
                 throw new CloudRuntimeException("copy volume failed: " + result.getResult());
             }
             return result.getVolume();
         } catch (InterruptedException e) {
-            s_logger.debug("Failed to copy volume: " + volume.getId(), e);
+            logger.debug("Failed to copy volume: " + volume.getId(), e);
             throw new CloudRuntimeException("Failed to copy volume", e);
         } catch (ExecutionException e) {
-            s_logger.debug("Failed to copy volume: " + volume.getId(), e);
+            logger.debug("Failed to copy volume: " + volume.getId(), e);
             throw new CloudRuntimeException("Failed to copy volume", e);
         }
     }
@@ -504,12 +502,12 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
 
         pool = findStoragePool(dskCh, dc, pod, clusterId, vm.getHostId(), vm, avoidPools);
         if (pool == null) {
-            s_logger.warn("Unable to find suitable primary storage when creating volume " + volume.getName());
+            logger.warn("Unable to find suitable primary storage when creating volume " + volume.getName());
             throw new CloudRuntimeException("Unable to find suitable primary storage when creating volume " + volume.getName());
         }
 
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Trying to create " + volume + " on " + pool);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Trying to create " + volume + " on " + pool);
         }
         DataStore store = dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
         for (int i = 0; i < 2; i++) {
@@ -526,20 +524,20 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                 VolumeApiResult result = future.get();
                 if (result.isFailed()) {
                     if (result.getResult().contains("request template reload") && (i == 0)) {
-                        s_logger.debug("Retry template re-deploy for vmware");
+                        logger.debug("Retry template re-deploy for vmware");
                         continue;
                     } else {
-                        s_logger.debug("create volume failed: " + result.getResult());
+                        logger.debug("create volume failed: " + result.getResult());
                         throw new CloudRuntimeException("create volume failed:" + result.getResult());
                     }
                 }
 
                 return result.getVolume();
             } catch (InterruptedException e) {
-                s_logger.error("create volume failed", e);
+                logger.error("create volume failed", e);
                 throw new CloudRuntimeException("create volume failed", e);
             } catch (ExecutionException e) {
-                s_logger.error("create volume failed", e);
+                logger.error("create volume failed", e);
                 throw new CloudRuntimeException("create volume failed", e);
             }
         }
@@ -674,10 +672,10 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         if (rootDisksize != null ) {
             rootDisksize = rootDisksize * 1024 * 1024 * 1024;
             if (rootDisksize > size) {
-                s_logger.debug("Using root disk size of " + rootDisksize + " Bytes for volume " + name);
+                logger.debug("Using root disk size of " + rootDisksize + " Bytes for volume " + name);
                 size = rootDisksize;
             } else {
-                s_logger.debug("Using root disk size of " + size + " Bytes for volume " + name + "since specified root disk size of " + rootDisksize + " Bytes is smaller than template");
+                logger.debug("Using root disk size of " + size + " Bytes for volume " + name + "since specified root disk size of " + rootDisksize + " Bytes is smaller than template");
             }
         }
 
@@ -818,8 +816,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         Long volTemplateId = existingVolume.getTemplateId();
         long vmTemplateId = vm.getTemplateId();
         if (volTemplateId != null && volTemplateId.longValue() != vmTemplateId) {
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("switchVolume: Old Volume's templateId: " + volTemplateId + " does not match the VM's templateId: " + vmTemplateId
+            if (logger.isDebugEnabled()) {
+                logger.debug("switchVolume: Old Volume's templateId: " + volTemplateId + " does not match the VM's templateId: " + vmTemplateId
                         + ", updating templateId in the new Volume");
             }
             templateIdToUse = vmTemplateId;
@@ -833,16 +831,16 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                 try {
                     stateTransitTo(existingVolume, Volume.Event.DestroyRequested);
                 } catch (NoTransitionException e) {
-                    s_logger.debug("Unable to destroy existing volume: " + e.toString());
+                    logger.debug("Unable to destroy existing volume: " + e.toString());
                 }
                 // In case of VMware VM will continue to use the old root disk until expunged, so force expunge old root disk
                 if (vm.getHypervisorType() == HypervisorType.VMware) {
-                    s_logger.info("Expunging volume " + existingVolume.getId() + " from primary data store");
+                    logger.info("Expunging volume " + existingVolume.getId() + " from primary data store");
                     AsyncCallFuture<VolumeApiResult> future = volService.expungeVolumeAsync(volFactory.getVolume(existingVolume.getId()));
                     try {
                         future.get();
                     } catch (Exception e) {
-                        s_logger.debug("Failed to expunge volume:" + existingVolume.getId(), e);
+                        logger.debug("Failed to expunge volume:" + existingVolume.getId(), e);
                     }
                 }
 
@@ -859,8 +857,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
     @Override
     @DB
     public void cleanupVolumes(long vmId) throws ConcurrentOperationException {
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Cleaning storage for vm: " + vmId);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Cleaning storage for vm: " + vmId);
         }
         final List<VolumeVO> volumesForVm = _volsDao.findByInstance(vmId);
         final List<VolumeVO> toBeExpunged = new ArrayList<VolumeVO>();
@@ -875,12 +873,12 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                         if (!volumeAlreadyDestroyed) {
                             volService.destroyVolume(vol.getId());
                         } else {
-                            s_logger.debug("Skipping destroy for the volume " + vol + " as its in state " + vol.getState().toString());
+                            logger.debug("Skipping destroy for the volume " + vol + " as its in state " + vol.getState().toString());
                         }
                         toBeExpunged.add(vol);
                     } else {
-                        if (s_logger.isDebugEnabled()) {
-                            s_logger.debug("Detaching " + vol);
+                        if (logger.isDebugEnabled()) {
+                            logger.debug("Detaching " + vol);
                         }
                         _volsDao.detachVolume(vol.getId());
                     }
@@ -894,9 +892,9 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
             try {
                 future.get();
             } catch (InterruptedException e) {
-                s_logger.debug("failed expunge volume" + expunge.getId(), e);
+                logger.debug("failed expunge volume" + expunge.getId(), e);
             } catch (ExecutionException e) {
-                s_logger.debug("failed expunge volume" + expunge.getId(), e);
+                logger.debug("failed expunge volume" + expunge.getId(), e);
             }
         }
     }
@@ -938,7 +936,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         try {
             VolumeApiResult result = future.get();
             if (result.isFailed()) {
-                s_logger.error("Migrate volume failed:" + result.getResult());
+                logger.error("Migrate volume failed:" + result.getResult());
                 throw new StorageUnavailableException("Migrate volume failed: " + result.getResult(), destPool.getId());
             } else {
                 // update the volumeId for snapshots on secondary
@@ -949,10 +947,10 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
             }
             return result.getVolume();
         } catch (InterruptedException e) {
-            s_logger.debug("migrate volume failed", e);
+            logger.debug("migrate volume failed", e);
             throw new CloudRuntimeException(e.getMessage());
         } catch (ExecutionException e) {
-            s_logger.debug("migrate volume failed", e);
+            logger.debug("migrate volume failed", e);
             throw new CloudRuntimeException(e.getMessage());
         }
     }
@@ -964,15 +962,15 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         try {
             VolumeApiResult result = future.get();
             if (result.isFailed()) {
-                s_logger.debug("migrate volume failed:" + result.getResult());
+                logger.debug("migrate volume failed:" + result.getResult());
                 return null;
             }
             return result.getVolume();
         } catch (InterruptedException e) {
-            s_logger.debug("migrate volume failed", e);
+            logger.debug("migrate volume failed", e);
             return null;
         } catch (ExecutionException e) {
-            s_logger.debug("migrate volume failed", e);
+            logger.debug("migrate volume failed", e);
             return null;
         }
     }
@@ -1003,13 +1001,13 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         try {
             CommandResult result = future.get();
             if (result.isFailed()) {
-                s_logger.debug("Failed to migrated vm " + vm + " along with its volumes. " + result.getResult());
+                logger.debug("Failed to migrated vm " + vm + " along with its volumes. " + result.getResult());
                 throw new CloudRuntimeException("Failed to migrated vm " + vm + " along with its volumes. ");
             }
         } catch (InterruptedException e) {
-            s_logger.debug("Failed to migrated vm " + vm + " along with its volumes.", e);
+            logger.debug("Failed to migrated vm " + vm + " along with its volumes.", e);
         } catch (ExecutionException e) {
-            s_logger.debug("Failed to migrated vm " + vm + " along with its volumes.", e);
+            logger.debug("Failed to migrated vm " + vm + " along with its volumes.", e);
         }
     }
 
@@ -1020,12 +1018,12 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
 
         for (VolumeVO volume : vols) {
             if (volume.getState() != Volume.State.Ready) {
-                s_logger.debug("volume: " + volume.getId() + " is in " + volume.getState() + " state");
+                logger.debug("volume: " + volume.getId() + " is in " + volume.getState() + " state");
                 throw new CloudRuntimeException("volume: " + volume.getId() + " is in " + volume.getState() + " state");
             }
 
             if (volume.getPoolId() == destPool.getId()) {
-                s_logger.debug("volume: " + volume.getId() + " is on the same storage pool: " + destPool.getId());
+                logger.debug("volume: " + volume.getId() + " is on the same storage pool: " + destPool.getId());
                 continue;
             }
 
@@ -1033,7 +1031,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         }
 
         if (volumesNeedToMigrate.isEmpty()) {
-            s_logger.debug("No volume need to be migrated");
+            logger.debug("No volume need to be migrated");
             return true;
         }
 
@@ -1049,8 +1047,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
     @Override
     public void prepareForMigration(VirtualMachineProfile vm, DeployDestination dest) {
         List<VolumeVO> vols = _volsDao.findUsableVolumesForInstance(vm.getId());
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Preparing " + vols.size() + " volumes for " + vm);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Preparing " + vols.size() + " volumes for " + vm);
         }
 
         for (VolumeVO vol : vols) {
@@ -1138,21 +1136,21 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                     tasks.add(task);
                 } else {
                     if (vol.isRecreatable()) {
-                        if (s_logger.isDebugEnabled()) {
-                            s_logger.debug("Volume " + vol + " will be recreated on storage pool " + assignedPool + " assigned by deploymentPlanner");
+                        if (logger.isDebugEnabled()) {
+                            logger.debug("Volume " + vol + " will be recreated on storage pool " + assignedPool + " assigned by deploymentPlanner");
                         }
                         VolumeTask task = new VolumeTask(VolumeTaskType.RECREATE, vol, null);
                         tasks.add(task);
                     } else {
                         if (assignedPool.getId() != vol.getPoolId()) {
-                            if (s_logger.isDebugEnabled()) {
-                                s_logger.debug("Mismatch in storage pool " + assignedPool + " assigned by deploymentPlanner and the one associated with volume " + vol);
+                            if (logger.isDebugEnabled()) {
+                                logger.debug("Mismatch in storage pool " + assignedPool + " assigned by deploymentPlanner and the one associated with volume " + vol);
                             }
                             DiskOffering diskOffering = _entityMgr.findById(DiskOffering.class, vol.getDiskOfferingId());
                             if (diskOffering.getUseLocalStorage()) {
                                 // Currently migration of local volume is not supported so bail out
-                                if (s_logger.isDebugEnabled()) {
-                                    s_logger.debug("Local volume " + vol + " cannot be recreated on storagepool " + assignedPool + " assigned by deploymentPlanner");
+                                if (logger.isDebugEnabled()) {
+                                    logger.debug("Local volume " + vol + " cannot be recreated on storagepool " + assignedPool + " assigned by deploymentPlanner");
                                 }
                                 throw new CloudRuntimeException("Local volume " + vol + " cannot be recreated on storagepool " + assignedPool + " assigned by deploymentPlanner");
                             } else {
@@ -1165,8 +1163,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                                     storageMigrationEnabled = StorageMigrationEnabled.value();
                                 }
                                 if(storageMigrationEnabled){
-                                    if (s_logger.isDebugEnabled()) {
-                                        s_logger.debug("Shared volume " + vol + " will be migrated on storage pool " + assignedPool + " assigned by deploymentPlanner");
+                                    if (logger.isDebugEnabled()) {
+                                        logger.debug("Shared volume " + vol + " will be migrated on storage pool " + assignedPool + " assigned by deploymentPlanner");
                                     }
                                     VolumeTask task = new VolumeTask(VolumeTaskType.MIGRATE, vol, assignedPool);
                                     tasks.add(task);
@@ -1187,8 +1185,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                     throw new StorageUnavailableException("Volume has no pool associate and also no storage pool assigned in DeployDestination, Unable to create " + vol,
                             Volume.class, vol.getId());
                 }
-                if (s_logger.isDebugEnabled()) {
-                    s_logger.debug("No need to recreate the volume: " + vol + ", since it already has a pool assigned: " + vol.getPoolId() + ", adding disk to VM");
+                if (logger.isDebugEnabled()) {
+                    logger.debug("No need to recreate the volume: " + vol + ", since it already has a pool assigned: " + vol.getPoolId() + ", adding disk to VM");
                 }
                 StoragePoolVO pool = _storagePoolDao.findById(vol.getPoolId());
                 VolumeTask task = new VolumeTask(VolumeTaskType.NOP, vol, pool);
@@ -1205,7 +1203,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         DataStore destPool = null;
         if (recreate && (dest.getStorageForDisks() == null || dest.getStorageForDisks().get(vol) == null)) {
             destPool = dataStoreMgr.getDataStore(vol.getPoolId(), DataStoreRole.Primary);
-            s_logger.debug("existing pool: " + destPool.getId());
+            logger.debug("existing pool: " + destPool.getId());
         } else {
             StoragePool pool = dest.getStorageForDisks().get(vol);
             destPool = dataStoreMgr.getDataStore(pool.getId(), DataStoreRole.Primary);
@@ -1222,8 +1220,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                 dest.getStorageForDisks().put(newVol, poolWithOldVol);
                 dest.getStorageForDisks().remove(vol);
             }
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("Created new volume " + newVol + " for old volume " + vol);
+            if (logger.isDebugEnabled()) {
+                logger.debug("Created new volume " + newVol + " for old volume " + vol);
             }
         }
         VolumeInfo volume = volFactory.getVolume(newVol.getId(), destPool);
@@ -1245,7 +1243,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
 
                 TemplateInfo templ = tmplFactory.getReadyTemplateOnImageStore(templateId, dest.getDataCenter().getId());
                 if (templ == null) {
-                    s_logger.debug("can't find ready template: " + templateId + " for data center " + dest.getDataCenter().getId());
+                    logger.debug("can't find ready template: " + templateId + " for data center " + dest.getDataCenter().getId());
                     throw new CloudRuntimeException("can't find ready template: " + templateId + " for data center " + dest.getDataCenter().getId());
                 }
 
@@ -1271,10 +1269,10 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                 result = future.get();
                 if (result.isFailed()) {
                     if (result.getResult().contains("request template reload") && (i == 0)) {
-                        s_logger.debug("Retry template re-deploy for vmware");
+                        logger.debug("Retry template re-deploy for vmware");
                         continue;
                     } else {
-                        s_logger.debug("Unable to create " + newVol + ":" + result.getResult());
+                        logger.debug("Unable to create " + newVol + ":" + result.getResult());
                         throw new StorageUnavailableException("Unable to create " + newVol + ":" + result.getResult(), destPool.getId());
                     }
                 }
@@ -1291,10 +1289,10 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                 newVol = _volsDao.findById(newVol.getId());
                 break; //break out of template-redeploy retry loop
             } catch (InterruptedException e) {
-                s_logger.error("Unable to create " + newVol, e);
+                logger.error("Unable to create " + newVol, e);
                 throw new StorageUnavailableException("Unable to create " + newVol + ":" + e.toString(), destPool.getId());
             } catch (ExecutionException e) {
-                s_logger.error("Unable to create " + newVol, e);
+                logger.error("Unable to create " + newVol, e);
                 throw new StorageUnavailableException("Unable to create " + newVol + ":" + e.toString(), destPool.getId());
             }
         }
@@ -1306,8 +1304,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
     public void prepare(VirtualMachineProfile vm, DeployDestination dest) throws StorageUnavailableException, InsufficientStorageCapacityException, ConcurrentOperationException {
 
         if (dest == null) {
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("DeployDestination cannot be null, cannot prepare Volumes for the vm: " + vm);
+            if (logger.isDebugEnabled()) {
+                logger.debug("DeployDestination cannot be null, cannot prepare Volumes for the vm: " + vm);
             }
             throw new CloudRuntimeException("Unable to prepare Volume for vm because DeployDestination is null, vm:" + vm);
         }
@@ -1318,8 +1316,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         }
 
         List<VolumeVO> vols = _volsDao.findUsableVolumesForInstance(vm.getId());
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Checking if we need to prepare " + vols.size() + " volumes for " + vm);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Checking if we need to prepare " + vols.size() + " volumes for " + vm);
         }
 
         List<VolumeTask> tasks = getTasks(vols, dest.getStorageForDisks(), vm);
@@ -1398,7 +1396,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         }
 
         if (volume.getState().equals(Volume.State.Creating)) {
-            s_logger.debug("Remove volume: " + volume.getId() + ", as it's leftover from last mgt server stop");
+            logger.debug("Remove volume: " + volume.getId() + ", as it's leftover from last mgt server stop");
             _volsDao.remove(volume.getId());
         }
     }
@@ -1413,11 +1411,11 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         if (volume.getState() == Volume.State.Migrating) {
             VolumeVO duplicateVol = _volsDao.findByPoolIdName(destPoolId, volume.getName());
             if (duplicateVol != null) {
-                s_logger.debug("Remove volume " + duplicateVol.getId() + " on storage pool " + destPoolId);
+                logger.debug("Remove volume " + duplicateVol.getId() + " on storage pool " + destPoolId);
                 _volsDao.remove(duplicateVol.getId());
             }
 
-            s_logger.debug("change volume state to ready from migrating in case migration failure for vol: " + volumeId);
+            logger.debug("change volume state to ready from migrating in case migration failure for vol: " + volumeId);
             volume.setState(Volume.State.Ready);
             _volsDao.update(volumeId, volume);
         }
@@ -1428,7 +1426,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
         _snapshotSrv.cleanupVolumeDuringSnapshotFailure(volumeId, snapshotId);
         VolumeVO volume = _volsDao.findById(volumeId);
         if (volume.getState() == Volume.State.Snapshotting) {
-            s_logger.debug("change volume state back to Ready: " + volume.getId());
+            logger.debug("change volume state back to Ready: " + volume.getId());
             volume.setState(Volume.State.Ready);
             _volsDao.update(volume.getId(), volume);
         }
@@ -1453,7 +1451,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
                     cleanupVolumeDuringSnapshotFailure(work.getVolumeId(), work.getSnapshotId());
                 }
             } catch (Exception e) {
-                s_logger.debug("clean up job failure, will continue", e);
+                logger.debug("clean up job failure, will continue", e);
             }
         }
     }
@@ -1486,7 +1484,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
             //FIXME - why recalculate and not decrement
             _resourceLimitMgr.recalculateResourceCount(volume.getAccountId(), volume.getDomainId(), ResourceType.primary_storage.getOrdinal());
         } catch (Exception e) {
-            s_logger.debug("Failed to destroy volume" + volume.getId(), e);
+            logger.debug("Failed to destroy volume" + volume.getId(), e);
             throw new CloudRuntimeException("Failed to destroy volume" + volume.getId(), e);
         }
     }
@@ -1517,7 +1515,7 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati
             needUpdate = true;
 
         if (needUpdate) {
-            s_logger.info("Update volume disk chain info. vol: " + vol.getId() + ", " + vol.getPath() + " -> " + path + ", " + vol.getChainInfo() + " -> " + chainInfo);
+            logger.info("Update volume disk chain info. vol: " + vol.getId() + ", " + vol.getPath() + " -> " + path + ", " + vol.getChainInfo() + " -> " + chainInfo);
             vol.setPath(path);
             vol.setChainInfo(chainInfo);
             _volsDao.update(volumeId, vol);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
index 2bd6bcc..946e08c 100644
--- a/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
+++ b/engine/schema/src/com/cloud/capacity/dao/CapacityDaoImpl.java
@@ -28,7 +28,6 @@ import java.util.Map.Entry;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao;
@@ -52,7 +51,6 @@ import com.cloud.utils.exception.CloudRuntimeException;
 @Component
 @Local(value = {CapacityDao.class})
 public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements CapacityDao {
-    private static final Logger s_logger = Logger.getLogger(CapacityDaoImpl.class);
 
     private static final String ADD_ALLOCATED_SQL = "UPDATE `cloud`.`op_host_capacity` SET used_capacity = used_capacity + ? WHERE host_id = ? AND capacity_type = ?";
     private static final String SUBTRACT_ALLOCATED_SQL =
@@ -523,7 +521,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
             txn.commit();
         } catch (Exception e) {
             txn.rollback();
-            s_logger.warn("Exception updating capacity for host: " + hostId, e);
+            logger.warn("Exception updating capacity for host: " + hostId, e);
         }
     }
 
@@ -988,7 +986,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
             }
             pstmt.executeUpdate();
         } catch (Exception e) {
-            s_logger.warn("Error updating CapacityVO", e);
+            logger.warn("Error updating CapacityVO", e);
         }
     }
 
@@ -1008,7 +1006,7 @@ public class CapacityDaoImpl extends GenericDaoBase<CapacityVO, Long> implements
                 return rs.getFloat(1);
             }
         } catch (Exception e) {
-            s_logger.warn("Error checking cluster threshold", e);
+            logger.warn("Error checking cluster threshold", e);
         }
         return 0;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/certificate/dao/CertificateDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/certificate/dao/CertificateDaoImpl.java b/engine/schema/src/com/cloud/certificate/dao/CertificateDaoImpl.java
index 978fee0..d6d944d 100644
--- a/engine/schema/src/com/cloud/certificate/dao/CertificateDaoImpl.java
+++ b/engine/schema/src/com/cloud/certificate/dao/CertificateDaoImpl.java
@@ -18,7 +18,6 @@ package com.cloud.certificate.dao;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.certificate.CertificateVO;
@@ -30,7 +29,6 @@ import com.cloud.utils.db.GenericDaoBase;
 @DB
 public class CertificateDaoImpl extends GenericDaoBase<CertificateVO, Long> implements CertificateDao {
 
-    private static final Logger s_logger = Logger.getLogger(CertificateDaoImpl.class);
 
     public CertificateDaoImpl() {
 
@@ -44,7 +42,7 @@ public class CertificateDaoImpl extends GenericDaoBase<CertificateVO, Long> impl
             update(cert.getId(), cert);
             return cert.getId();
         } catch (Exception e) {
-            s_logger.warn("Unable to read the certificate: " + e);
+            logger.warn("Unable to read the certificate: " + e);
             return new Long(0);
         }
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/cluster/agentlb/dao/HostTransferMapDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/cluster/agentlb/dao/HostTransferMapDaoImpl.java b/engine/schema/src/com/cloud/cluster/agentlb/dao/HostTransferMapDaoImpl.java
index 483ea45..493ee48 100644
--- a/engine/schema/src/com/cloud/cluster/agentlb/dao/HostTransferMapDaoImpl.java
+++ b/engine/schema/src/com/cloud/cluster/agentlb/dao/HostTransferMapDaoImpl.java
@@ -22,7 +22,6 @@ import java.util.List;
 import javax.annotation.PostConstruct;
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.cluster.agentlb.HostTransferMapVO;
@@ -36,7 +35,6 @@ import com.cloud.utils.db.SearchCriteria;
 @Local(value = {HostTransferMapDao.class})
 @DB
 public class HostTransferMapDaoImpl extends GenericDaoBase<HostTransferMapVO, Long> implements HostTransferMapDao {
-    private static final Logger s_logger = Logger.getLogger(HostTransferMapDaoImpl.class);
 
     protected SearchBuilder<HostTransferMapVO> AllFieldsSearch;
     protected SearchBuilder<HostTransferMapVO> IntermediateStateSearch;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
index 373446e..5c216e7 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterDaoImpl.java
@@ -26,7 +26,6 @@ import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 import javax.persistence.TableGenerator;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.DataCenterDetailVO;
@@ -58,7 +57,6 @@ import com.cloud.utils.net.NetUtils;
 @Component
 @Local(value = {DataCenterDao.class})
 public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implements DataCenterDao {
-    private static final Logger s_logger = Logger.getLogger(DataCenterDaoImpl.class);
 
     protected SearchBuilder<DataCenterVO> NameSearch;
     protected SearchBuilder<DataCenterVO> ListZonesByDomainIdSearch;
@@ -412,7 +410,7 @@ public class DataCenterDaoImpl extends GenericDaoBase<DataCenterVO, Long> implem
                     Long dcId = Long.parseLong(tokenOrIdOrName);
                     return findById(dcId);
                 } catch (NumberFormatException nfe) {
-                    s_logger.debug("Cannot parse " + tokenOrIdOrName + " into long. " + nfe);
+                    logger.debug("Cannot parse " + tokenOrIdOrName + " into long. " + nfe);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
index ca79eed..21501c5 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterIpAddressDaoImpl.java
@@ -23,7 +23,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.DataCenterIpAddressVO;
@@ -41,7 +40,6 @@ import com.cloud.utils.net.NetUtils;
 @Local(value = {DataCenterIpAddressDao.class})
 @DB
 public class DataCenterIpAddressDaoImpl extends GenericDaoBase<DataCenterIpAddressVO, Long> implements DataCenterIpAddressDao {
-    private static final Logger s_logger = Logger.getLogger(DataCenterIpAddressDaoImpl.class);
 
     private final SearchBuilder<DataCenterIpAddressVO> AllFieldsSearch;
     private final GenericSearchBuilder<DataCenterIpAddressVO, Integer> AllIpCount;
@@ -144,8 +142,8 @@ public class DataCenterIpAddressDaoImpl extends GenericDaoBase<DataCenterIpAddre
 
     @Override
     public void releaseIpAddress(String ipAddress, long dcId, Long instanceId) {
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Releasing ip address: " + ipAddress + " data center " + dcId);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Releasing ip address: " + ipAddress + " data center " + dcId);
         }
         SearchCriteria<DataCenterIpAddressVO> sc = AllFieldsSearch.create();
         sc.setParameters("ip", ipAddress);
@@ -162,8 +160,8 @@ public class DataCenterIpAddressDaoImpl extends GenericDaoBase<DataCenterIpAddre
 
     @Override
     public void releaseIpAddress(long nicId, String reservationId) {
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Releasing ip address for reservationId=" + reservationId + ", instance=" + nicId);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Releasing ip address for reservationId=" + reservationId + ", instance=" + nicId);
         }
         SearchCriteria<DataCenterIpAddressVO> sc = AllFieldsSearch.create();
         sc.setParameters("instance", nicId);
@@ -178,8 +176,8 @@ public class DataCenterIpAddressDaoImpl extends GenericDaoBase<DataCenterIpAddre
 
     @Override
     public void releaseIpAddress(long nicId) {
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Releasing ip address for instance=" + nicId);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Releasing ip address for instance=" + nicId);
         }
         SearchCriteria<DataCenterIpAddressVO> sc = AllFieldsSearch.create();
         sc.setParameters("instance", nicId);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/dc/dao/DataCenterLinkLocalIpAddressDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/DataCenterLinkLocalIpAddressDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/DataCenterLinkLocalIpAddressDaoImpl.java
index 5917123..ca10761 100644
--- a/engine/schema/src/com/cloud/dc/dao/DataCenterLinkLocalIpAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/DataCenterLinkLocalIpAddressDaoImpl.java
@@ -25,7 +25,6 @@ import java.util.Map;
 import javax.ejb.Local;
 import javax.naming.ConfigurationException;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.DataCenterLinkLocalIpAddressVO;
@@ -43,7 +42,6 @@ import com.cloud.utils.net.NetUtils;
 @Local(value = {DataCenterLinkLocalIpAddressDaoImpl.class})
 @DB
 public class DataCenterLinkLocalIpAddressDaoImpl extends GenericDaoBase<DataCenterLinkLocalIpAddressVO, Long> implements DataCenterLinkLocalIpAddressDao {
-    private static final Logger s_logger = Logger.getLogger(DataCenterLinkLocalIpAddressDaoImpl.class);
 
     private final SearchBuilder<DataCenterLinkLocalIpAddressVO> AllFieldsSearch;
     private final GenericSearchBuilder<DataCenterLinkLocalIpAddressVO, Integer> AllIpCount;
@@ -107,8 +105,8 @@ public class DataCenterLinkLocalIpAddressDaoImpl extends GenericDaoBase<DataCent
 
     @Override
     public void releaseIpAddress(String ipAddress, long dcId, long instanceId) {
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Releasing ip address: " + ipAddress + " data center " + dcId);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Releasing ip address: " + ipAddress + " data center " + dcId);
         }
         SearchCriteria<DataCenterLinkLocalIpAddressVO> sc = AllFieldsSearch.create();
         sc.setParameters("ip", ipAddress);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/dc/dao/HostPodDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/dc/dao/HostPodDaoImpl.java b/engine/schema/src/com/cloud/dc/dao/HostPodDaoImpl.java
index 1137eb8..0dd943c 100644
--- a/engine/schema/src/com/cloud/dc/dao/HostPodDaoImpl.java
+++ b/engine/schema/src/com/cloud/dc/dao/HostPodDaoImpl.java
@@ -25,7 +25,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.HostPodVO;
@@ -40,7 +39,6 @@ import com.cloud.utils.db.TransactionLegacy;
 @Component
 @Local(value = {HostPodDao.class})
 public class HostPodDaoImpl extends GenericDaoBase<HostPodVO, Long> implements HostPodDao {
-    private static final Logger s_logger = Logger.getLogger(HostPodDaoImpl.class);
 
     protected SearchBuilder<HostPodVO> DataCenterAndNameSearch;
     protected SearchBuilder<HostPodVO> DataCenterIdSearch;
@@ -102,7 +100,7 @@ public class HostPodDaoImpl extends GenericDaoBase<HostPodVO, Long> implements H
                 currentPodCidrSubnets.put(podId, cidrPair);
             }
         } catch (SQLException ex) {
-            s_logger.warn("DB exception " + ex.getMessage(), ex);
+            logger.warn("DB exception " + ex.getMessage(), ex);
             return null;
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java b/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java
index 223172e..ca2a0b5 100644
--- a/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java
+++ b/engine/schema/src/com/cloud/domain/dao/DomainDaoImpl.java
@@ -25,7 +25,6 @@ import java.util.Set;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.domain.Domain;
@@ -40,7 +39,6 @@ import com.cloud.utils.db.TransactionLegacy;
 @Component
 @Local(value = {DomainDao.class})
 public class DomainDaoImpl extends GenericDaoBase<DomainVO, Long> implements DomainDao {
-    private static final Logger s_logger = Logger.getLogger(DomainDaoImpl.class);
 
     protected SearchBuilder<DomainVO> DomainNameLikeSearch;
     protected SearchBuilder<DomainVO> ParentDomainNameLikeSearch;
@@ -112,7 +110,7 @@ public class DomainDaoImpl extends GenericDaoBase<DomainVO, Long> implements Dom
 
         DomainVO parentDomain = findById(parent);
         if (parentDomain == null) {
-            s_logger.error("Unable to load parent domain: " + parent);
+            logger.error("Unable to load parent domain: " + parent);
             return null;
         }
 
@@ -122,7 +120,7 @@ public class DomainDaoImpl extends GenericDaoBase<DomainVO, Long> implements Dom
 
             parentDomain = this.lockRow(parent, true);
             if (parentDomain == null) {
-                s_logger.error("Unable to lock parent domain: " + parent);
+                logger.error("Unable to lock parent domain: " + parent);
                 return null;
             }
 
@@ -137,7 +135,7 @@ public class DomainDaoImpl extends GenericDaoBase<DomainVO, Long> implements Dom
             txn.commit();
             return domain;
         } catch (Exception e) {
-            s_logger.error("Unable to create domain due to " + e.getMessage(), e);
+            logger.error("Unable to create domain due to " + e.getMessage(), e);
             txn.rollback();
             return null;
         }
@@ -148,23 +146,23 @@ public class DomainDaoImpl extends GenericDaoBase<DomainVO, Long> implements Dom
     public boolean remove(Long id) {
         // check for any active users / domains assigned to the given domain id and don't remove the domain if there are any
         if (id != null && id.longValue() == Domain.ROOT_DOMAIN) {
-            s_logger.error("Can not remove domain " + id + " as it is ROOT domain");
+            logger.error("Can not remove domain " + id + " as it is ROOT domain");
             return false;
         } else {
             if(id == null) {
-                s_logger.error("Can not remove domain without id.");
+                logger.error("Can not remove domain without id.");
                 return false;
             }
         }
 
         DomainVO domain = findById(id);
         if (domain == null) {
-            s_logger.info("Unable to remove domain as domain " + id + " no longer exists");
+            logger.info("Unable to remove domain as domain " + id + " no longer exists");
             return true;
         }
 
         if (domain.getParent() == null) {
-            s_logger.error("Invalid domain " + id + ", orphan?");
+            logger.error("Invalid domain " + id + ", orphan?");
             return false;
         }
 
@@ -177,7 +175,7 @@ public class DomainDaoImpl extends GenericDaoBase<DomainVO, Long> implements Dom
             txn.start();
             DomainVO parentDomain = super.lockRow(domain.getParent(), true);
             if (parentDomain == null) {
-                s_logger.error("Unable to load parent domain: " + domain.getParent());
+                logger.error("Unable to load parent domain: " + domain.getParent());
                 return false;
             }
 
@@ -198,7 +196,7 @@ public class DomainDaoImpl extends GenericDaoBase<DomainVO, Long> implements Dom
             txn.commit();
         } catch (SQLException ex) {
             success = false;
-            s_logger.error("error removing domain: " + id, ex);
+            logger.error("error removing domain: " + id, ex);
             txn.rollback();
         }
         return success;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java b/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java
index be589e7..3ad5fe0 100644
--- a/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java
+++ b/engine/schema/src/com/cloud/event/dao/EventDaoImpl.java
@@ -21,7 +21,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.event.Event.State;
@@ -36,7 +35,6 @@ import com.cloud.utils.db.TransactionLegacy;
 @Component
 @Local(value = {EventDao.class})
 public class EventDaoImpl extends GenericDaoBase<EventVO, Long> implements EventDao {
-    public static final Logger s_logger = Logger.getLogger(EventDaoImpl.class.getName());
     protected final SearchBuilder<EventVO> CompletedEventSearch;
     protected final SearchBuilder<EventVO> ToArchiveOrDeleteEventSearch;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java b/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java
index 1739254..8134ea8 100644
--- a/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java
+++ b/engine/schema/src/com/cloud/event/dao/UsageEventDaoImpl.java
@@ -26,7 +26,6 @@ import java.util.TimeZone;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.Vlan;
@@ -44,7 +43,6 @@ import com.cloud.utils.exception.CloudRuntimeException;
 @Component
 @Local(value = {UsageEventDao.class})
 public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implements UsageEventDao {
-    public static final Logger s_logger = Logger.getLogger(UsageEventDaoImpl.class.getName());
 
     private final SearchBuilder<UsageEventVO> latestEventsSearch;
     private final SearchBuilder<UsageEventVO> IpeventsSearch;
@@ -103,8 +101,8 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
         // Copy events from cloud db to usage db
         String sql = COPY_EVENTS;
         if (recentEventId == 0) {
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("no recent event date, copying all events");
+            if (logger.isDebugEnabled()) {
+                logger.debug("no recent event date, copying all events");
             }
             sql = COPY_ALL_EVENTS;
         }
@@ -122,7 +120,7 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
             txn.commit();
         } catch (Exception ex) {
             txn.rollback();
-            s_logger.error("error copying events from cloud db to usage db", ex);
+            logger.error("error copying events from cloud db to usage db", ex);
             throw new CloudRuntimeException(ex.getMessage());
         } finally {
             txn.close();
@@ -131,8 +129,8 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
         // Copy event details from cloud db to usage db
         sql = COPY_EVENT_DETAILS;
         if (recentEventId == 0) {
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("no recent event date, copying all event detailss");
+            if (logger.isDebugEnabled()) {
+                logger.debug("no recent event date, copying all event detailss");
             }
             sql = COPY_ALL_EVENT_DETAILS;
         }
@@ -150,7 +148,7 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
             txn.commit();
         } catch (Exception ex) {
             txn.rollback();
-            s_logger.error("error copying event details from cloud db to usage db", ex);
+            logger.error("error copying event details from cloud db to usage db", ex);
             throw new CloudRuntimeException(ex.getMessage());
         } finally {
             txn.close();
@@ -173,7 +171,7 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
             }
             return 0;
         } catch (Exception ex) {
-            s_logger.error("error getting most recent event id", ex);
+            logger.error("error getting most recent event id", ex);
             throw new CloudRuntimeException(ex.getMessage());
         } finally {
             txn.close();
@@ -185,7 +183,7 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
         try {
             return listLatestEvents(endDate);
         } catch (Exception ex) {
-            s_logger.error("error getting most recent event date", ex);
+            logger.error("error getting most recent event date", ex);
             throw new CloudRuntimeException(ex.getMessage());
         } finally {
             txn.close();
@@ -205,7 +203,7 @@ public class UsageEventDaoImpl extends GenericDaoBase<UsageEventVO, Long> implem
             }
             return 0;
         } catch (Exception ex) {
-            s_logger.error("error getting max event id", ex);
+            logger.error("error getting max event id", ex);
             throw new CloudRuntimeException(ex.getMessage());
         } finally {
             txn.close();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java b/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java
index 35d77c1..583ba79 100644
--- a/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java
+++ b/engine/schema/src/com/cloud/event/dao/UsageEventDetailsDaoImpl.java
@@ -21,7 +21,6 @@ import java.util.Map;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.event.UsageEventDetailsVO;
@@ -33,7 +32,6 @@ import com.cloud.utils.db.TransactionLegacy;
 @Component
 @Local(value = {UsageEventDetailsDao.class})
 public class UsageEventDetailsDaoImpl extends GenericDaoBase<UsageEventDetailsVO, Long> implements UsageEventDetailsDao {
-    public static final Logger s_logger = Logger.getLogger(UsageEventDetailsDaoImpl.class.getName());
 
     protected final SearchBuilder<UsageEventDetailsVO> EventDetailsSearch;
     protected final SearchBuilder<UsageEventDetailsVO> DetailSearch;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDaoImpl.java b/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDaoImpl.java
index 6bddea2..669a18b 100644
--- a/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDaoImpl.java
+++ b/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDaoImpl.java
@@ -20,7 +20,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.gpu.HostGpuGroupsVO;
@@ -32,7 +31,6 @@ import com.cloud.utils.db.SearchCriteria;
 @Component
 @Local(value = HostGpuGroupsDao.class)
 public class HostGpuGroupsDaoImpl extends GenericDaoBase<HostGpuGroupsVO, Long> implements HostGpuGroupsDao {
-    private static final Logger s_logger = Logger.getLogger(HostGpuGroupsDaoImpl.class);
 
     private final SearchBuilder<HostGpuGroupsVO> _hostIdGroupNameSearch;
     private final SearchBuilder<HostGpuGroupsVO> _searchByHostId;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java b/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java
index 96e3a62..6fb774c 100644
--- a/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java
+++ b/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java
@@ -28,7 +28,6 @@ import java.util.Map.Entry;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.VgpuTypesInfo;
@@ -43,7 +42,6 @@ import com.cloud.utils.exception.CloudRuntimeException;
 @Component
 @Local(value = VGPUTypesDao.class)
 public class VGPUTypesDaoImpl extends GenericDaoBase<VGPUTypesVO, Long> implements VGPUTypesDao {
-    private static final Logger s_logger = Logger.getLogger(VGPUTypesDaoImpl.class);
 
     private final SearchBuilder<VGPUTypesVO> _searchByGroupId;
     private final SearchBuilder<VGPUTypesVO> _searchByGroupIdVGPUType;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
index 8342f1f..578a19d 100644
--- a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
+++ b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java
@@ -31,7 +31,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.persistence.TableGenerator;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.VgpuTypesInfo;
@@ -71,9 +70,6 @@ import com.cloud.utils.exception.CloudRuntimeException;
 @DB
 @TableGenerator(name = "host_req_sq", table = "op_host", pkColumnName = "id", valueColumnName = "sequence", allocationSize = 1)
 public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao { //FIXME: , ExternalIdDao {
-    private static final Logger s_logger = Logger.getLogger(HostDaoImpl.class);
-    private static final Logger status_logger = Logger.getLogger(Status.class);
-    private static final Logger state_logger = Logger.getLogger(ResourceState.class);
 
     protected SearchBuilder<HostVO> TypePodDcStatusSearch;
 
@@ -289,7 +285,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
         try {
             HostTransferSearch = _hostTransferDao.createSearchBuilder();
         } catch (Throwable e) {
-            s_logger.debug("error", e);
+            logger.debug("error", e);
         }
         HostTransferSearch.and("id", HostTransferSearch.entity().getId(), SearchCriteria.Op.NULL);
         UnmanagedDirectConnectSearch.join("hostTransferSearch", HostTransferSearch, HostTransferSearch.entity().getId(), UnmanagedDirectConnectSearch.entity().getId(),
@@ -445,8 +441,8 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
             sb.append(" ");
         }
 
-        if (s_logger.isTraceEnabled()) {
-            s_logger.trace("Following hosts got reset: " + sb.toString());
+        if (logger.isTraceEnabled()) {
+            logger.trace("Following hosts got reset: " + sb.toString());
         }
     }
 
@@ -505,19 +501,19 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
         TransactionLegacy txn = TransactionLegacy.currentTxn();
 
         txn.start();
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Resetting hosts suitable for reconnect");
+        if (logger.isDebugEnabled()) {
+            logger.debug("Resetting hosts suitable for reconnect");
         }
         // reset hosts that are suitable candidates for reconnect
         resetHosts(managementServerId, lastPingSecondsAfter);
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Completed resetting hosts suitable for reconnect");
+        if (logger.isDebugEnabled()) {
+            logger.debug("Completed resetting hosts suitable for reconnect");
         }
 
         List<HostVO> assignedHosts = new ArrayList<HostVO>();
 
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Acquiring hosts for clusters already owned by this management server");
+        if (logger.isDebugEnabled()) {
+            logger.debug("Acquiring hosts for clusters already owned by this management server");
         }
         List<Long> clusters = findClustersOwnedByManagementServer(managementServerId);
         if (clusters.size() > 0) {
@@ -535,17 +531,17 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
                 sb.append(host.getId());
                 sb.append(" ");
             }
-            if (s_logger.isTraceEnabled()) {
-                s_logger.trace("Following hosts got acquired for clusters already owned: " + sb.toString());
+            if (logger.isTraceEnabled()) {
+                logger.trace("Following hosts got acquired for clusters already owned: " + sb.toString());
             }
         }
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Completed acquiring hosts for clusters already owned by this management server");
+        if (logger.isDebugEnabled()) {
+            logger.debug("Completed acquiring hosts for clusters already owned by this management server");
         }
 
         if (assignedHosts.size() < limit) {
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("Acquiring hosts for clusters not owned by any management server");
+            if (logger.isDebugEnabled()) {
+                logger.debug("Acquiring hosts for clusters not owned by any management server");
             }
             // for remaining hosts not owned by any MS check if they can be owned (by owning full cluster)
             clusters = findClustersForHostsNotOwnedByAnyManagementServer();
@@ -585,12 +581,12 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
                         break;
                     }
                 }
-                if (s_logger.isTraceEnabled()) {
-                    s_logger.trace("Following hosts got acquired from newly owned clusters: " + sb.toString());
+                if (logger.isTraceEnabled()) {
+                    logger.trace("Following hosts got acquired from newly owned clusters: " + sb.toString());
                 }
             }
-            if (s_logger.isDebugEnabled()) {
-                s_logger.debug("Completed acquiring hosts for clusters not owned by any management server");
+            if (logger.isDebugEnabled()) {
+                logger.debug("Completed acquiring hosts for clusters not owned by any management server");
             }
         }
         txn.commit();
@@ -754,7 +750,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
                 }
             }
         } catch (SQLException e) {
-            s_logger.warn("Exception: ", e);
+            logger.warn("Exception: ", e);
         }
         return result;
     }
@@ -865,15 +861,15 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
                 l.add(info);
             }
         } catch (SQLException e) {
-            s_logger.debug("SQLException caught", e);
+            logger.debug("SQLException caught", e);
         }
         return l;
     }
 
     @Override
     public long getNextSequence(long hostId) {
-        if (s_logger.isTraceEnabled()) {
-            s_logger.trace("getNextSequence(), hostId: " + hostId);
+        if (logger.isTraceEnabled()) {
+            logger.trace("getNextSequence(), hostId: " + hostId);
         }
 
         TableGenerator tg = _tgs.get("host_req_sq");
@@ -953,7 +949,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
             HostVO ho = findById(host.getId());
             assert ho != null : "How how how? : " + host.getId();
 
-            if (status_logger.isDebugEnabled()) {
+            if (logger.isDebugEnabled()) {
 
                 StringBuilder str = new StringBuilder("Unable to update host for event:").append(event.toString());
                 str.append(". Name=").append(host.getName());
@@ -975,7 +971,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
                         .append(":old update count=")
                         .append(oldUpdateCount)
                         .append("]");
-                status_logger.debug(str.toString());
+                logger.debug(str.toString());
             } else {
                 StringBuilder msg = new StringBuilder("Agent status update: [");
                 msg.append("id = " + host.getId());
@@ -985,11 +981,11 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
                 msg.append("; new status = " + newStatus);
                 msg.append("; old update count = " + oldUpdateCount);
                 msg.append("; new update count = " + newUpdateCount + "]");
-                status_logger.debug(msg.toString());
+                logger.debug(msg.toString());
             }
 
             if (ho.getState() == newStatus) {
-                status_logger.debug("Host " + ho.getName() + " state has already been updated to " + newStatus);
+                logger.debug("Host " + ho.getName() + " state has already been updated to " + newStatus);
                 return true;
             }
         }
@@ -1015,7 +1011,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
         int result = update(ub, sc, null);
         assert result <= 1 : "How can this update " + result + " rows? ";
 
-        if (state_logger.isDebugEnabled() && result == 0) {
+        if (logger.isDebugEnabled() && result == 0) {
             HostVO ho = findById(host.getId());
             assert ho != null : "How how how? : " + host.getId();
 
@@ -1025,7 +1021,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
             str.append("; old state = " + oldState);
             str.append("; event = " + event);
             str.append("; new state = " + newState + "]");
-            state_logger.debug(str.toString());
+            logger.debug(str.toString());
         } else {
             StringBuilder msg = new StringBuilder("Resource state update: [");
             msg.append("id = " + host.getId());
@@ -1033,7 +1029,7 @@ public class HostDaoImpl extends GenericDaoBase<HostVO, Long> implements HostDao
             msg.append("; old state = " + oldState);
             msg.append("; event = " + event);
             msg.append("; new state = " + newState + "]");
-            state_logger.debug(msg.toString());
+            logger.debug(msg.toString());
         }
 
         return result > 0;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java b/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
index 2b94e69..b8f07cb 100644
--- a/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
+++ b/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java
@@ -20,7 +20,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -33,7 +32,6 @@ import com.cloud.utils.db.SearchCriteria;
 @Local(value = HypervisorCapabilitiesDao.class)
 public class HypervisorCapabilitiesDaoImpl extends GenericDaoBase<HypervisorCapabilitiesVO, Long> implements HypervisorCapabilitiesDao {
 
-    private static final Logger s_logger = Logger.getLogger(HypervisorCapabilitiesDaoImpl.class);
 
     protected final SearchBuilder<HypervisorCapabilitiesVO> HypervisorTypeSearch;
     protected final SearchBuilder<HypervisorCapabilitiesVO> HypervisorTypeAndVersionSearch;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java b/engine/schema/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
index e89536b..35be85b 100644
--- a/engine/schema/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/FirewallRulesCidrsDaoImpl.java
@@ -21,7 +21,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.DB;
@@ -33,7 +32,6 @@ import com.cloud.utils.db.TransactionLegacy;
 @Component
 @Local(value = FirewallRulesCidrsDao.class)
 public class FirewallRulesCidrsDaoImpl extends GenericDaoBase<FirewallRulesCidrsVO, Long> implements FirewallRulesCidrsDao {
-    private static final Logger s_logger = Logger.getLogger(FirewallRulesCidrsDaoImpl.class);
     protected final SearchBuilder<FirewallRulesCidrsVO> CidrsSearch;
 
     protected FirewallRulesCidrsDaoImpl() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
index 5122876..460630b 100644
--- a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java
@@ -26,7 +26,6 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 
 import org.apache.cloudstack.resourcedetail.dao.UserIpAddressDetailsDao;
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.dc.Vlan.VlanType;
@@ -50,7 +49,6 @@ import com.cloud.utils.net.Ip;
 @Local(value = {IPAddressDao.class})
 @DB
 public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implements IPAddressDao {
-    private static final Logger s_logger = Logger.getLogger(IPAddressDaoImpl.class);
 
     protected SearchBuilder<IPAddressVO> AllFieldsSearch;
     protected SearchBuilder<IPAddressVO> VlanDbIdSearchUnallocated;
@@ -322,7 +320,7 @@ public class IPAddressDaoImpl extends GenericDaoBase<IPAddressVO, Long> implemen
                 ipCount = rs.getInt(1);
             }
         } catch (Exception e) {
-            s_logger.warn("Exception counting IP addresses", e);
+            logger.warn("Exception counting IP addresses", e);
         }
 
         return ipCount;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/network/dao/PortProfileDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/PortProfileDaoImpl.java b/engine/schema/src/com/cloud/network/dao/PortProfileDaoImpl.java
index 211280d..5a81947 100644
--- a/engine/schema/src/com/cloud/network/dao/PortProfileDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/PortProfileDaoImpl.java
@@ -23,7 +23,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.DB;
@@ -38,7 +37,6 @@ import com.cloud.utils.exception.CloudRuntimeException;
 @Local(value = PortProfileDao.class)
 @DB()
 public class PortProfileDaoImpl extends GenericDaoBase<PortProfileVO, Long> implements PortProfileDao {
-    protected static final Logger s_logger = Logger.getLogger(PortProfileDaoImpl.class);
 
     final SearchBuilder<PortProfileVO> nameSearch;
     final SearchBuilder<PortProfileVO> accessVlanSearch;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnDaoImpl.java b/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnDaoImpl.java
index 965d433..34d96b9 100644
--- a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnDaoImpl.java
@@ -20,7 +20,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.RemoteAccessVpn;
@@ -31,7 +30,6 @@ import com.cloud.utils.db.SearchCriteria;
 @Component
 @Local(value = {RemoteAccessVpnDao.class})
 public class RemoteAccessVpnDaoImpl extends GenericDaoBase<RemoteAccessVpnVO, Long> implements RemoteAccessVpnDao {
-    private static final Logger s_logger = Logger.getLogger(RemoteAccessVpnDaoImpl.class);
 
     private final SearchBuilder<RemoteAccessVpnVO> AllFieldsSearch;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionDaoImpl.java b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionDaoImpl.java
index e32533f..8329f3d 100644
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionDaoImpl.java
@@ -22,7 +22,6 @@ import javax.annotation.PostConstruct;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.GenericDaoBase;
@@ -33,7 +32,6 @@ import com.cloud.utils.db.SearchCriteria;
 @Component
 @Local(value = {Site2SiteVpnConnectionDao.class})
 public class Site2SiteVpnConnectionDaoImpl extends GenericDaoBase<Site2SiteVpnConnectionVO, Long> implements Site2SiteVpnConnectionDao {
-    private static final Logger s_logger = Logger.getLogger(Site2SiteVpnConnectionDaoImpl.class);
 
     @Inject
     protected IPAddressDao _addrDao;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayDaoImpl.java b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayDaoImpl.java
index 658ca0a..7951b05 100644
--- a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayDaoImpl.java
@@ -19,7 +19,6 @@ package com.cloud.network.dao;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.utils.db.GenericDaoBase;
@@ -32,7 +31,6 @@ public class Site2SiteVpnGatewayDaoImpl extends GenericDaoBase<Site2SiteVpnGatew
     @Inject
     protected IPAddressDao _addrDao;
 
-    private static final Logger s_logger = Logger.getLogger(Site2SiteVpnGatewayDaoImpl.class);
 
     private final SearchBuilder<Site2SiteVpnGatewayVO> AllFieldsSearch;
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java b/engine/schema/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java
index f0ba199..c0ba455 100644
--- a/engine/schema/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/dao/UserIpv6AddressDaoImpl.java
@@ -20,7 +20,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.UserIpv6AddressVO;
@@ -34,7 +33,6 @@ import com.cloud.utils.db.SearchCriteria.Op;
 @Component
 @Local(value = UserIpv6AddressDao.class)
 public class UserIpv6AddressDaoImpl extends GenericDaoBase<UserIpv6AddressVO, Long> implements UserIpv6AddressDao {
-    private static final Logger s_logger = Logger.getLogger(IPAddressDaoImpl.class);
 
     protected final SearchBuilder<UserIpv6AddressVO> AllFieldsSearch;
     protected GenericSearchBuilder<UserIpv6AddressVO, Long> CountFreePublicIps;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/network/security/dao/VmRulesetLogDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/security/dao/VmRulesetLogDaoImpl.java b/engine/schema/src/com/cloud/network/security/dao/VmRulesetLogDaoImpl.java
index 8fe9375..e430910 100644
--- a/engine/schema/src/com/cloud/network/security/dao/VmRulesetLogDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/security/dao/VmRulesetLogDaoImpl.java
@@ -27,7 +27,6 @@ import java.util.Set;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.security.VmRulesetLogVO;
@@ -39,7 +38,6 @@ import com.cloud.utils.db.TransactionLegacy;
 @Component
 @Local(value = {VmRulesetLogDao.class})
 public class VmRulesetLogDaoImpl extends GenericDaoBase<VmRulesetLogVO, Long> implements VmRulesetLogDao {
-    protected static final Logger s_logger = Logger.getLogger(VmRulesetLogDaoImpl.class);
     private SearchBuilder<VmRulesetLogVO> VmIdSearch;
     private String InsertOrUpdateSQl = "INSERT INTO op_vm_ruleset_log (instance_id, created, logsequence) "
         + " VALUES(?, now(), 1) ON DUPLICATE KEY UPDATE logsequence=logsequence+1";
@@ -100,19 +98,19 @@ public class VmRulesetLogDaoImpl extends GenericDaoBase<VmRulesetLogVO, Long> im
             } catch (SQLTransactionRollbackException e1) {
                 if (i < maxTries - 1) {
                     int delayMs = (i + 1) * 1000;
-                    s_logger.debug("Caught a deadlock exception while inserting security group rule log, retrying in " + delayMs);
+                    logger.debug("Caught a deadlock exception while inserting security group rule log, retrying in " + delayMs);
                     try {
                         Thread.sleep(delayMs);
                     } catch (InterruptedException ie) {
-                        s_logger.debug("[ignored] interupted while inserting security group rule log.");
+                        logger.debug("[ignored] interupted while inserting security group rule logger.");
                     }
                 } else
-                    s_logger.warn("Caught another deadlock exception while retrying inserting security group rule log, giving up");
+                    logger.warn("Caught another deadlock exception while retrying inserting security group rule log, giving up");
 
             }
         }
-        if (s_logger.isTraceEnabled()) {
-            s_logger.trace("Inserted or updated " + numUpdated + " rows");
+        if (logger.isTraceEnabled()) {
+            logger.trace("Inserted or updated " + numUpdated + " rows");
         }
         return numUpdated;
     }
@@ -136,8 +134,8 @@ public class VmRulesetLogDaoImpl extends GenericDaoBase<VmRulesetLogVO, Long> im
                             vmIds.add(vmId);
                         }
                         int numUpdated = executeWithRetryOnDeadlock(txn, pstmt, vmIds);
-                        if (s_logger.isTraceEnabled()) {
-                            s_logger.trace("Inserted or updated " + numUpdated + " rows");
+                        if (logger.isTraceEnabled()) {
+                            logger.trace("Inserted or updated " + numUpdated + " rows");
                         }
                         if (numUpdated > 0)
                             count += stmtSize;
@@ -147,7 +145,7 @@ public class VmRulesetLogDaoImpl extends GenericDaoBase<VmRulesetLogVO, Long> im
 
             }
         } catch (SQLException sqe) {
-            s_logger.warn("Failed to execute multi insert ", sqe);
+            logger.warn("Failed to execute multi insert ", sqe);
         }
 
         return count;
@@ -175,10 +173,10 @@ public class VmRulesetLogDaoImpl extends GenericDaoBase<VmRulesetLogVO, Long> im
             queryResult = stmtInsert.executeBatch();
 
             txn.commit();
-            if (s_logger.isTraceEnabled())
-                s_logger.trace("Updated or inserted " + workItems.size() + " log items");
+            if (logger.isTraceEnabled())
+                logger.trace("Updated or inserted " + workItems.size() + " log items");
         } catch (SQLException e) {
-            s_logger.warn("Failed to execute batch update statement for ruleset log: ", e);
+            logger.warn("Failed to execute batch update statement for ruleset log: ", e);
             txn.rollback();
             success = false;
         }
@@ -187,7 +185,7 @@ public class VmRulesetLogDaoImpl extends GenericDaoBase<VmRulesetLogVO, Long> im
             workItems.toArray(arrayItems);
             for (int i = 0; i < queryResult.length; i++) {
                 if (queryResult[i] < 0) {
-                    s_logger.debug("Batch query update failed for vm " + arrayItems[i]);
+                    logger.debug("Batch query update failed for vm " + arrayItems[i]);
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java b/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java
index 4c2574e..dd28fe3 100644
--- a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java
@@ -23,7 +23,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.vpc.NetworkACLItemCidrsDao;
@@ -40,7 +39,6 @@ import com.cloud.utils.db.TransactionLegacy;
 @Component
 @Local(value = NetworkACLItemCidrsDao.class)
 public class NetworkACLItemCidrsDaoImpl extends GenericDaoBase<NetworkACLItemCidrsVO, Long> implements NetworkACLItemCidrsDao {
-    private static final Logger s_logger = Logger.getLogger(NetworkACLItemCidrsDaoImpl.class);
     protected final SearchBuilder<NetworkACLItemCidrsVO> cidrsSearch;
 
     protected NetworkACLItemCidrsDaoImpl() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemDaoImpl.java b/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemDaoImpl.java
index 201197c..d600868 100644
--- a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemDaoImpl.java
@@ -21,7 +21,6 @@ import java.util.List;
 import javax.ejb.Local;
 import javax.inject.Inject;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.vpc.NetworkACLItem.State;
@@ -40,7 +39,6 @@ import com.cloud.utils.db.TransactionLegacy;
 @Local(value = NetworkACLItemDao.class)
 @DB()
 public class NetworkACLItemDaoImpl extends GenericDaoBase<NetworkACLItemVO, Long> implements NetworkACLItemDao {
-    private static final Logger s_logger = Logger.getLogger(NetworkACLItemDaoImpl.class);
 
     protected final SearchBuilder<NetworkACLItemVO> AllFieldsSearch;
     protected final SearchBuilder<NetworkACLItemVO> NotRevokedSearch;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/network/vpc/dao/PrivateIpDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/network/vpc/dao/PrivateIpDaoImpl.java b/engine/schema/src/com/cloud/network/vpc/dao/PrivateIpDaoImpl.java
index 2178452..a276890 100644
--- a/engine/schema/src/com/cloud/network/vpc/dao/PrivateIpDaoImpl.java
+++ b/engine/schema/src/com/cloud/network/vpc/dao/PrivateIpDaoImpl.java
@@ -21,7 +21,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.network.vpc.PrivateIpVO;
@@ -38,7 +37,6 @@ import com.cloud.utils.db.TransactionLegacy;
 @Local(value = PrivateIpDao.class)
 @DB()
 public class PrivateIpDaoImpl extends GenericDaoBase<PrivateIpVO, Long> implements PrivateIpDao {
-    private static final Logger s_logger = Logger.getLogger(PrivateIpDaoImpl.class);
 
     private final SearchBuilder<PrivateIpVO> AllFieldsSearch;
     private final GenericSearchBuilder<PrivateIpVO, Integer> CountAllocatedByNetworkId;
@@ -92,8 +90,8 @@ public class PrivateIpDaoImpl extends GenericDaoBase<PrivateIpVO, Long> implemen
 
     @Override
     public void releaseIpAddress(String ipAddress, long networkId) {
-        if (s_logger.isDebugEnabled()) {
-            s_logger.debug("Releasing private ip address: " + ipAddress + " network id " + networkId);
+        if (logger.isDebugEnabled()) {
+            logger.debug("Releasing private ip address: " + ipAddress + " network id " + networkId);
         }
         SearchCriteria<PrivateIpVO> sc = AllFieldsSearch.create();
         sc.setParameters("ip", ipAddress);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java
----------------------------------------------------------------------
diff --git a/engine/schema/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java b/engine/schema/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java
index 2ecf3fb..7565041 100644
--- a/engine/schema/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java
+++ b/engine/schema/src/com/cloud/projects/dao/ProjectAccountDaoImpl.java
@@ -20,7 +20,6 @@ import java.util.List;
 
 import javax.ejb.Local;
 
-import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.projects.ProjectAccount;
@@ -39,7 +38,6 @@ public class ProjectAccountDaoImpl extends GenericDaoBase<ProjectAccountVO, Long
     final GenericSearchBuilder<ProjectAccountVO, Long> AdminSearch;
     final GenericSearchBuilder<ProjectAccountVO, Long> ProjectAccountSearch;
     final GenericSearchBuilder<ProjectAccountVO, Long> CountByRoleSearch;
-    public static final Logger s_logger = Logger.getLogger(ProjectAccountDaoImpl.class.getName());
 
     protected ProjectAccountDaoImpl() {
         AllFieldsSearch = createSearchBuilder();
@@ -150,7 +148,7 @@ public class ProjectAccountDaoImpl extends GenericDaoBase<ProjectAccountVO, Long
 
         int rowsRemoved = remove(sc);
         if (rowsRemoved > 0) {
-            s_logger.debug("Removed account id=" + accountId + " from " + rowsRemoved + " projects");
+            logger.debug("Removed account id=" + accountId + " from " + rowsRemoved + " projects");
         }
     }
 


Mime
View raw message