http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/user/dao/VmDiskStatisticsDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/user/dao/VmDiskStatisticsDaoImpl.java b/engine/schema/src/com/cloud/user/dao/VmDiskStatisticsDaoImpl.java index 56a1d3e..1cd746d 100644 --- a/engine/schema/src/com/cloud/user/dao/VmDiskStatisticsDaoImpl.java +++ b/engine/schema/src/com/cloud/user/dao/VmDiskStatisticsDaoImpl.java @@ -25,7 +25,6 @@ import java.util.TimeZone; import javax.ejb.Local; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import com.cloud.user.VmDiskStatisticsVO; @@ -38,7 +37,6 @@ import com.cloud.utils.db.TransactionLegacy; @Component @Local(value = {VmDiskStatisticsDao.class}) public class VmDiskStatisticsDaoImpl extends GenericDaoBase<VmDiskStatisticsVO, Long> implements VmDiskStatisticsDao { - private static final Logger s_logger = Logger.getLogger(VmDiskStatisticsDaoImpl.class); private static final String ACTIVE_AND_RECENTLY_DELETED_SEARCH = "SELECT bcf.id, bcf.data_center_id, bcf.account_id, bcf.vm_id, bcf.volume_id, bcf.agg_io_read, bcf.agg_io_write, bcf.agg_bytes_read, bcf.agg_bytes_write " + "FROM vm_disk_statistics bcf, account a " + "WHERE bcf.account_id = a.id AND (a.removed IS NULL OR a.removed >= ?) " + "ORDER BY bcf.id"; @@ -106,7 +104,7 @@ public class VmDiskStatisticsDaoImpl extends GenericDaoBase<VmDiskStatisticsVO, vmDiskStats.add(toEntityBean(rs, false)); } } catch (Exception ex) { - s_logger.error("error saving vm disk stats to cloud_usage db", ex); + logger.error("error saving vm disk stats to cloud_usage db", ex); } return vmDiskStats; } @@ -124,7 +122,7 @@ public class VmDiskStatisticsDaoImpl extends GenericDaoBase<VmDiskStatisticsVO, vmDiskStats.add(toEntityBean(rs, false)); } } catch (Exception ex) { - s_logger.error("error lisitng updated vm disk stats", ex); + logger.error("error lisitng updated vm disk stats", ex); } return vmDiskStats; }
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java index 210300f..40bb971 100644 --- a/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/ConsoleProxyDaoImpl.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.info.ConsoleProxyLoadInfo; @@ -42,7 +41,6 @@ import com.cloud.vm.VirtualMachine.State; @Component @Local(value = {ConsoleProxyDao.class}) public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO, Long> implements ConsoleProxyDao { - private static final Logger s_logger = Logger.getLogger(ConsoleProxyDaoImpl.class); // // query SQL for returnning console proxy assignment info as following @@ -217,7 +215,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO, Long> im l.add(new Pair<Long, Integer>(rs.getLong(1), rs.getInt(2))); } } catch (SQLException e) { - s_logger.debug("Caught SQLException: ", e); + logger.debug("Caught SQLException: ", e); } return l; } @@ -242,7 +240,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO, Long> im l.add(new Pair<Long, Integer>(rs.getLong(1), rs.getInt(2))); } } catch (SQLException e) { - s_logger.debug("Caught SQLException: ", e); + logger.debug("Caught SQLException: ", e); } return l; } @@ -261,7 +259,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO, Long> im return rs.getInt(1); } } catch (SQLException e) { - s_logger.debug("Caught SQLException: ", e); + logger.debug("Caught SQLException: ", e); } return 0; } @@ -279,7 +277,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO, Long> im return rs.getInt(1); } } catch (SQLException e) { - s_logger.debug("Caught SQLException: ", e); + logger.debug("Caught SQLException: ", e); } return 0; } @@ -301,7 +299,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO, Long> im l.add(info); } } catch (SQLException e) { - s_logger.debug("Exception: ", e); + logger.debug("Exception: ", e); } return l; } @@ -323,7 +321,7 @@ public class ConsoleProxyDaoImpl extends GenericDaoBase<ConsoleProxyVO, Long> im l.add(rs.getLong(1)); } } catch (SQLException e) { - s_logger.debug("Caught SQLException: ", e); + logger.debug("Caught SQLException: ", e); } return l; } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/vm/dao/UserVmCloneSettingDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/vm/dao/UserVmCloneSettingDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/UserVmCloneSettingDaoImpl.java index 3007810..d6da4fb 100644 --- a/engine/schema/src/com/cloud/vm/dao/UserVmCloneSettingDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/UserVmCloneSettingDaoImpl.java @@ -21,7 +21,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.utils.db.DB; @@ -35,7 +34,6 @@ import com.cloud.vm.UserVmCloneSettingVO; @Local(value = {UserVmCloneSettingDao.class}) @DB() public class UserVmCloneSettingDaoImpl extends GenericDaoBase<UserVmCloneSettingVO, Long> implements UserVmCloneSettingDao { - public static final Logger s_logger = Logger.getLogger(UserVmCloneSettingDaoImpl.class); protected SearchBuilder<UserVmCloneSettingVO> vmIdSearch; protected SearchBuilder<UserVmCloneSettingVO> cloneTypeSearch; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java index 1f2843d..c9099cd 100644 --- a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java @@ -30,7 +30,6 @@ import javax.annotation.PostConstruct; import javax.ejb.Local; import javax.inject.Inject; -import org.apache.log4j.Logger; import com.cloud.server.ResourceTag.ResourceObjectType; import com.cloud.tags.dao.ResourceTagDao; @@ -55,7 +54,6 @@ import com.cloud.vm.dao.UserVmData.SecurityGroupData; @Local(value = {UserVmDao.class}) public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements UserVmDao { - public static final Logger s_logger = Logger.getLogger(UserVmDaoImpl.class); protected SearchBuilder<UserVmVO> AccountPodSearch; protected SearchBuilder<UserVmVO> AccountDataCenterSearch; @@ -378,13 +376,13 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use } } catch (Exception e) { - s_logger.error("listPodIdsHavingVmsforAccount:Exception: " + e.getMessage()); + logger.error("listPodIdsHavingVmsforAccount:Exception: " + e.getMessage()); throw new CloudRuntimeException("listPodIdsHavingVmsforAccount:Exception: " + e.getMessage(), e); } txn.commit(); return result; } catch (Exception e) { - s_logger.error("listPodIdsHavingVmsforAccount:Exception : " + e.getMessage()); + logger.error("listPodIdsHavingVmsforAccount:Exception : " + e.getMessage()); throw new CloudRuntimeException("listPodIdsHavingVmsforAccount:Exception: " + e.getMessage(), e); } finally { @@ -396,7 +394,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use } catch (Exception e) { - s_logger.error("listVmDetails:Exception:" + e.getMessage()); + logger.error("listVmDetails:Exception:" + e.getMessage()); } } @@ -433,7 +431,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use } catch (Exception e) { - s_logger.error("listVmDetails:Exception:" + e.getMessage()); + logger.error("listVmDetails:Exception:" + e.getMessage()); throw new CloudRuntimeException("listVmDetails: Exception:" + e.getMessage(),e); } curr_index += VM_DETAILS_BATCH_SIZE; @@ -441,7 +439,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use } catch (Exception e) { - s_logger.error("listVmDetails:Exception:" + e.getMessage()); + logger.error("listVmDetails:Exception:" + e.getMessage()); throw new CloudRuntimeException("listVmDetails: Exception:" + e.getMessage(),e); } } @@ -469,20 +467,20 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use } catch (Exception e) { - s_logger.error("listVmDetails: Exception:" + e.getMessage()); + logger.error("listVmDetails: Exception:" + e.getMessage()); throw new CloudRuntimeException("listVmDetails: Exception:" + e.getMessage(),e); } } catch (Exception e) { - s_logger.error("listVmDetails:Exception:" + e.getMessage()); + logger.error("listVmDetails:Exception:" + e.getMessage()); throw new CloudRuntimeException("listVmDetails: Exception:" + e.getMessage(),e); } } txn.commit(); return userVmDataHash; } catch (Exception e) { - s_logger.error("listVmDetails:Exception:" + e.getMessage()); + logger.error("listVmDetails:Exception:" + e.getMessage()); throw new CloudRuntimeException("listVmDetails:Exception : ", e); } finally { @@ -494,7 +492,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use } catch (Exception e) { - s_logger.error("listVmDetails:Exception:" + e.getMessage()); + logger.error("listVmDetails:Exception:" + e.getMessage()); } } @@ -656,7 +654,7 @@ public class UserVmDaoImpl extends GenericDaoBase<UserVmVO, Long> implements Use } } } catch (SQLException e) { - s_logger.error("GetVmsDetailsByNames: Exception in sql: " + e.getMessage()); + logger.error("GetVmsDetailsByNames: Exception in sql: " + e.getMessage()); throw new CloudRuntimeException("GetVmsDetailsByNames: Exception: " + e.getMessage()); } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java index be0e366..dd5f3ab 100644 --- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java @@ -29,7 +29,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.host.HostVO; @@ -66,7 +65,6 @@ import com.cloud.vm.VirtualMachine.Type; @Local(value = {VMInstanceDao.class}) public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implements VMInstanceDao { - public static final Logger s_logger = Logger.getLogger(VMInstanceDaoImpl.class); private static final int MAX_CONSECUTIVE_SAME_STATE_UPDATE_COUNT = 3; protected SearchBuilder<VMInstanceVO> VMClusterSearch; @@ -439,8 +437,8 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem @Override public boolean updateState(State oldState, Event event, State newState, VirtualMachine vm, Object opaque) { if (newState == null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("There's no way to transition from old state: " + oldState.toString() + " event: " + event.toString()); + if (logger.isDebugEnabled()) { + logger.debug("There's no way to transition from old state: " + oldState.toString() + " event: " + event.toString()); } return false; } @@ -479,7 +477,7 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem if (result == 0) { VMInstanceVO vo = findByIdIncludingRemoved(vm.getId()); - if (s_logger.isDebugEnabled()) { + if (logger.isDebugEnabled()) { if (vo != null) { StringBuilder str = new StringBuilder("Unable to update ").append(vo.toString()); str.append(": DB Data={Host=").append(vo.getHostId()).append("; State=").append(vo.getState().toString()).append("; updated=").append(vo.getUpdated()) @@ -488,16 +486,16 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem .append("; time=").append(vo.getUpdateTime()); str.append("} Stale Data: {Host=").append(oldHostId).append("; State=").append(oldState).append("; updated=").append(oldUpdated).append("; time=") .append(oldUpdateDate).append("}"); - s_logger.debug(str.toString()); + logger.debug(str.toString()); } else { - s_logger.debug("Unable to update the vm id=" + vm.getId() + "; the vm either doesn't exist or already removed"); + logger.debug("Unable to update the vm id=" + vm.getId() + "; the vm either doesn't exist or already removed"); } } if (vo != null && vo.getState() == newState) { // allow for concurrent update if target state has already been matched - s_logger.debug("VM " + vo.getInstanceName() + " state has been already been updated to " + newState); + logger.debug("VM " + vo.getInstanceName() + " state has been already been updated to " + newState); return true; } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDaoImpl.java b/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDaoImpl.java index a87d284..2ea46f2 100644 --- a/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/snapshot/dao/VMSnapshotDaoImpl.java @@ -22,7 +22,6 @@ import java.util.List; import javax.ejb.Local; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import com.cloud.utils.db.GenericDaoBase; @@ -38,7 +37,6 @@ import com.cloud.vm.snapshot.VMSnapshotVO; @Component @Local(value = {VMSnapshotDao.class}) public class VMSnapshotDaoImpl extends GenericDaoBase<VMSnapshotVO, Long> implements VMSnapshotDao { - private static final Logger s_logger = Logger.getLogger(VMSnapshotDaoImpl.class); private final SearchBuilder<VMSnapshotVO> SnapshotSearch; private final SearchBuilder<VMSnapshotVO> ExpungingSnapshotSearch; private final SearchBuilder<VMSnapshotVO> SnapshotStatusSearch; @@ -145,7 +143,7 @@ public class VMSnapshotDaoImpl extends GenericDaoBase<VMSnapshotVO, Long> implem builder.set(vo, "updated", new Date()); int rows = update((VMSnapshotVO)vo, sc); - if (rows == 0 && s_logger.isDebugEnabled()) { + if (rows == 0 && logger.isDebugEnabled()) { VMSnapshotVO dbVol = findByIdIncludingRemoved(vo.getId()); if (dbVol != null) { StringBuilder str = new StringBuilder("Unable to update ").append(vo.toString()); @@ -178,7 +176,7 @@ public class VMSnapshotDaoImpl extends GenericDaoBase<VMSnapshotVO, Long> implem .append("; updatedTime=") .append(oldUpdatedTime); } else { - s_logger.debug("Unable to update VM snapshot: id=" + vo.getId() + ", as there is no such snapshot exists in the database anymore"); + logger.debug("Unable to update VM snapshot: id=" + vo.getId() + ", as there is no such snapshot exists in the database anymore"); } } return rows > 0; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java index 6df243b..d681c30 100644 --- a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java +++ b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/dao/VMEntityDaoImpl.java @@ -23,7 +23,6 @@ import javax.annotation.PostConstruct; import javax.ejb.Local; import javax.inject.Inject; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.engine.cloud.entity.api.db.VMEntityVO; @@ -39,7 +38,6 @@ import com.cloud.utils.db.TransactionLegacy; @Local(value = {VMEntityDao.class}) public class VMEntityDaoImpl extends GenericDaoBase<VMEntityVO, Long> implements VMEntityDao { - public static final Logger s_logger = Logger.getLogger(VMEntityDaoImpl.class); @Inject protected VMReservationDao _vmReservationDao; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/schema/src/org/apache/cloudstack/region/dao/RegionDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/schema/src/org/apache/cloudstack/region/dao/RegionDaoImpl.java b/engine/schema/src/org/apache/cloudstack/region/dao/RegionDaoImpl.java index d7f102d..f9ff6bf 100644 --- a/engine/schema/src/org/apache/cloudstack/region/dao/RegionDaoImpl.java +++ b/engine/schema/src/org/apache/cloudstack/region/dao/RegionDaoImpl.java @@ -18,7 +18,6 @@ package org.apache.cloudstack.region.dao; import javax.ejb.Local; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.region.RegionVO; @@ -30,7 +29,6 @@ import com.cloud.utils.db.SearchCriteria; @Component @Local(value = {RegionDao.class}) public class RegionDaoImpl extends GenericDaoBase<RegionVO, Integer> implements RegionDao { - private static final Logger s_logger = Logger.getLogger(RegionDaoImpl.class); protected SearchBuilder<RegionVO> NameSearch; protected SearchBuilder<RegionVO> AllFieldsSearch; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java ---------------------------------------------------------------------- diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java index b34b697..91c886c 100644 --- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java +++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java @@ -26,7 +26,6 @@ import java.util.Map; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.agent.Listener; @@ -60,7 +59,6 @@ import com.cloud.utils.fsm.NoTransitionException; import com.cloud.utils.fsm.StateMachine2; public class DirectAgentManagerSimpleImpl extends ManagerBase implements AgentManager { - private static final Logger logger = Logger.getLogger(DirectAgentManagerSimpleImpl.class); private final Map<Long, ServerResource> hostResourcesMap = new HashMap<Long, ServerResource>(); @Inject HostDao hostDao; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java ---------------------------------------------------------------------- diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java index 13fd54c..c201cf6 100644 --- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java +++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java @@ -24,7 +24,6 @@ import java.util.Map; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import org.apache.cloudstack.engine.subsystem.api.storage.StrategyPriority; import org.apache.cloudstack.engine.subsystem.api.storage.VMSnapshotOptions; @@ -71,7 +70,6 @@ import com.cloud.vm.snapshot.VMSnapshotVO; import com.cloud.vm.snapshot.dao.VMSnapshotDao; public class DefaultVMSnapshotStrategy extends ManagerBase implements VMSnapshotStrategy { - private static final Logger s_logger = Logger.getLogger(DefaultVMSnapshotStrategy.class); @Inject VMSnapshotHelper vmSnapshotHelper; @Inject @@ -148,7 +146,7 @@ public class DefaultVMSnapshotStrategy extends ManagerBase implements VMSnapshot answer = (CreateVMSnapshotAnswer)agentMgr.send(hostId, ccmd); if (answer != null && answer.getResult()) { processAnswer(vmSnapshotVO, userVm, answer, hostId); - s_logger.debug("Create vm snapshot " + vmSnapshot.getName() + " succeeded for vm: " + userVm.getInstanceName()); + logger.debug("Create vm snapshot " + vmSnapshot.getName() + " succeeded for vm: " + userVm.getInstanceName()); result = true; for (VolumeObjectTO volumeTo : answer.getVolumeTOs()) { @@ -159,21 +157,21 @@ public class DefaultVMSnapshotStrategy extends ManagerBase implements VMSnapshot String errMsg = "Creating VM snapshot: " + vmSnapshot.getName() + " failed"; if (answer != null && answer.getDetails() != null) errMsg = errMsg + " due to " + answer.getDetails(); - s_logger.error(errMsg); + logger.error(errMsg); throw new CloudRuntimeException(errMsg); } } catch (OperationTimedoutException e) { - s_logger.debug("Creating VM snapshot: " + vmSnapshot.getName() + " failed: " + e.toString()); + logger.debug("Creating VM snapshot: " + vmSnapshot.getName() + " failed: " + e.toString()); throw new CloudRuntimeException("Creating VM snapshot: " + vmSnapshot.getName() + " failed: " + e.toString()); } catch (AgentUnavailableException e) { - s_logger.debug("Creating VM snapshot: " + vmSnapshot.getName() + " failed", e); + logger.debug("Creating VM snapshot: " + vmSnapshot.getName() + " failed", e); throw new CloudRuntimeException("Creating VM snapshot: " + vmSnapshot.getName() + " failed: " + e.toString()); } finally { if (!result) { try { vmSnapshotHelper.vmSnapshotStateTransitTo(vmSnapshot, VMSnapshot.Event.OperationFailed); } catch (NoTransitionException e1) { - s_logger.error("Cannot set vm snapshot state due to: " + e1.getMessage()); + logger.error("Cannot set vm snapshot state due to: " + e1.getMessage()); } } } @@ -186,7 +184,7 @@ public class DefaultVMSnapshotStrategy extends ManagerBase implements VMSnapshot try { vmSnapshotHelper.vmSnapshotStateTransitTo(vmSnapshot, VMSnapshot.Event.ExpungeRequested); } catch (NoTransitionException e) { - s_logger.debug("Failed to change vm snapshot state with event ExpungeRequested"); + logger.debug("Failed to change vm snapshot state with event ExpungeRequested"); throw new CloudRuntimeException("Failed to change vm snapshot state with event ExpungeRequested: " + e.getMessage()); } @@ -214,7 +212,7 @@ public class DefaultVMSnapshotStrategy extends ManagerBase implements VMSnapshot return true; } else { String errMsg = (answer == null) ? null : answer.getDetails(); - s_logger.error("Delete vm snapshot " + vmSnapshot.getName() + " of vm " + userVm.getInstanceName() + " failed due to " + errMsg); + logger.error("Delete vm snapshot " + vmSnapshot.getName() + " of vm " + userVm.getInstanceName() + " failed due to " + errMsg); throw new CloudRuntimeException("Delete vm snapshot " + vmSnapshot.getName() + " of vm " + userVm.getInstanceName() + " failed due to " + errMsg); } } catch (OperationTimedoutException e) { @@ -247,7 +245,7 @@ public class DefaultVMSnapshotStrategy extends ManagerBase implements VMSnapshot }); } catch (Exception e) { String errMsg = "Error while process answer: " + as.getClass() + " due to " + e.getMessage(); - s_logger.error(errMsg, e); + logger.error(errMsg, e); throw new CloudRuntimeException(errMsg); } } @@ -367,21 +365,21 @@ public class DefaultVMSnapshotStrategy extends ManagerBase implements VMSnapshot String errMsg = "Revert VM: " + userVm.getInstanceName() + " to snapshot: " + vmSnapshotVO.getName() + " failed"; if (answer != null && answer.getDetails() != null) errMsg = errMsg + " due to " + answer.getDetails(); - s_logger.error(errMsg); + logger.error(errMsg); throw new CloudRuntimeException(errMsg); } } catch (OperationTimedoutException e) { - s_logger.debug("Failed to revert vm snapshot", e); + logger.debug("Failed to revert vm snapshot", e); throw new CloudRuntimeException(e.getMessage()); } catch (AgentUnavailableException e) { - s_logger.debug("Failed to revert vm snapshot", e); + logger.debug("Failed to revert vm snapshot", e); throw new CloudRuntimeException(e.getMessage()); } finally { if (!result) { try { vmSnapshotHelper.vmSnapshotStateTransitTo(vmSnapshot, VMSnapshot.Event.OperationFailed); } catch (NoTransitionException e1) { - s_logger.error("Cannot set vm snapshot state due to: " + e1.getMessage()); + logger.error("Cannot set vm snapshot state due to: " + e1.getMessage()); } } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java index 73a8544..c446d16 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java @@ -28,7 +28,6 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; import com.cloud.storage.Storage; -import org.apache.log4j.Logger; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator; @@ -54,7 +53,6 @@ import com.cloud.vm.DiskProfile; import com.cloud.vm.VirtualMachineProfile; public abstract class AbstractStoragePoolAllocator extends AdapterBase implements StoragePoolAllocator { - private static final Logger s_logger = Logger.getLogger(AbstractStoragePoolAllocator.class); @Inject StorageManager storageMgr; protected @Inject @@ -116,8 +114,8 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement } List<Long> poolIdsByCapacity = _capacityDao.orderHostsByFreeCapacity(clusterId, capacityType); - if (s_logger.isDebugEnabled()) { - s_logger.debug("List of pools in descending order of free capacity: "+ poolIdsByCapacity); + if (logger.isDebugEnabled()) { + logger.debug("List of pools in descending order of free capacity: "+ poolIdsByCapacity); } //now filter the given list of Pools by this ordered list @@ -146,8 +144,8 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement Long clusterId = plan.getClusterId(); List<Long> poolIdsByVolCount = _volumeDao.listPoolIdsByVolumeCount(dcId, podId, clusterId, account.getAccountId()); - if (s_logger.isDebugEnabled()) { - s_logger.debug("List of pools in ascending order of number of volumes for account id: " + account.getAccountId() + " is: " + poolIdsByVolCount); + if (logger.isDebugEnabled()) { + logger.debug("List of pools in ascending order of number of volumes for account id: " + account.getAccountId() + " is: " + poolIdsByVolCount); } // now filter the given list of Pools by this ordered list @@ -189,12 +187,12 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement protected boolean filter(ExcludeList avoid, StoragePool pool, DiskProfile dskCh, DeploymentPlan plan) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Checking if storage pool is suitable, name: " + pool.getName() + " ,poolId: " + pool.getId()); + if (logger.isDebugEnabled()) { + logger.debug("Checking if storage pool is suitable, name: " + pool.getName() + " ,poolId: " + pool.getId()); } if (avoid.shouldAvoid(pool)) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("StoragePool is in avoid set, skipping this pool"); + if (logger.isDebugEnabled()) { + logger.debug("StoragePool is in avoid set, skipping this pool"); } return false; } @@ -203,14 +201,14 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement if (clusterId != null) { ClusterVO cluster = _clusterDao.findById(clusterId); if (!(cluster.getHypervisorType() == dskCh.getHypervisorType())) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("StoragePool's Cluster does not have required hypervisorType, skipping this pool"); + if (logger.isDebugEnabled()) { + logger.debug("StoragePool's Cluster does not have required hypervisorType, skipping this pool"); } return false; } } else if (pool.getHypervisor() != null && !pool.getHypervisor().equals(HypervisorType.Any) && !(pool.getHypervisor() == dskCh.getHypervisorType())) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("StoragePool does not have required hypervisorType, skipping this pool"); + if (logger.isDebugEnabled()) { + logger.debug("StoragePool does not have required hypervisorType, skipping this pool"); } return false; } @@ -235,13 +233,13 @@ public abstract class AbstractStoragePoolAllocator extends AdapterBase implement //LXC ROOT disks supports NFS and local storage pools only if(!(Storage.StoragePoolType.NetworkFilesystem.equals(poolType) || Storage.StoragePoolType.Filesystem.equals(poolType)) ){ - s_logger.debug("StoragePool does not support LXC ROOT disk, skipping this pool"); + logger.debug("StoragePool does not support LXC ROOT disk, skipping this pool"); return false; } } else if (Volume.Type.DATADISK.equals(volType)){ //LXC DATA disks supports RBD storage pool only if(!Storage.StoragePoolType.RBD.equals(poolType)){ - s_logger.debug("StoragePool does not support LXC DATA disk, skipping this pool"); + logger.debug("StoragePool does not support LXC DATA disk, skipping this pool"); return false; } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java index 761c3a8..d529710 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/GarbageCollectingStoragePoolAllocator.java @@ -23,7 +23,6 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; @@ -38,7 +37,6 @@ import com.cloud.vm.VirtualMachineProfile; @Local(value = StoragePoolAllocator.class) public class GarbageCollectingStoragePoolAllocator extends AbstractStoragePoolAllocator { - private static final Logger s_logger = Logger.getLogger(GarbageCollectingStoragePoolAllocator.class); StoragePoolAllocator _firstFitStoragePoolAllocator; StoragePoolAllocator _localStoragePoolAllocator; @@ -50,9 +48,9 @@ public class GarbageCollectingStoragePoolAllocator extends AbstractStoragePoolAl @Override public List<StoragePool> select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { - s_logger.debug("GarbageCollectingStoragePoolAllocator looking for storage pool"); + logger.debug("GarbageCollectingStoragePoolAllocator looking for storage pool"); if (!_storagePoolCleanupEnabled) { - s_logger.debug("Storage pool cleanup is not enabled, so GarbageCollectingStoragePoolAllocator is being skipped."); + logger.debug("Storage pool cleanup is not enabled, so GarbageCollectingStoragePoolAllocator is being skipped."); return null; } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java index a4edf76..51c7cb6 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java @@ -28,7 +28,6 @@ import javax.naming.ConfigurationException; import org.apache.cloudstack.engine.subsystem.api.storage.StoragePoolAllocator; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import com.cloud.capacity.dao.CapacityDao; @@ -47,7 +46,6 @@ import com.cloud.vm.dao.VMInstanceDao; @Component @Local(value = StoragePoolAllocator.class) public class LocalStoragePoolAllocator extends AbstractStoragePoolAllocator { - private static final Logger s_logger = Logger.getLogger(LocalStoragePoolAllocator.class); @Inject StoragePoolHostDao _poolHostDao; @@ -64,18 +62,18 @@ public class LocalStoragePoolAllocator extends AbstractStoragePoolAllocator { @Override protected List<StoragePool> select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { - s_logger.debug("LocalStoragePoolAllocator trying to find storage pool to fit the vm"); + logger.debug("LocalStoragePoolAllocator trying to find storage pool to fit the vm"); if (!dskCh.useLocalStorage()) { return null; } - if (s_logger.isTraceEnabled()) { + if (logger.isTraceEnabled()) { // Log the pools details that are ignored because they are in disabled state List<StoragePoolVO> disabledPools = _storagePoolDao.findDisabledPoolsByScope(plan.getDataCenterId(), plan.getPodId(), plan.getClusterId(), ScopeType.HOST); if (disabledPools != null && !disabledPools.isEmpty()) { for (StoragePoolVO pool : disabledPools) { - s_logger.trace("Ignoring pool " + pool + " as it is in disabled state."); + logger.trace("Ignoring pool " + pool + " as it is in disabled state."); } } } @@ -89,7 +87,7 @@ public class LocalStoragePoolAllocator extends AbstractStoragePoolAllocator { if (pool != null && pool.isLocal()) { StoragePool storagePool = (StoragePool)this.dataStoreMgr.getPrimaryDataStore(pool.getId()); if (filter(avoid, storagePool, dskCh, plan)) { - s_logger.debug("Found suitable local storage pool " + pool.getId() + ", adding to list"); + logger.debug("Found suitable local storage pool " + pool.getId() + ", adding to list"); suitablePools.add(storagePool); } else { avoid.addPool(pool.getId()); @@ -128,8 +126,8 @@ public class LocalStoragePoolAllocator extends AbstractStoragePoolAllocator { } } - if (s_logger.isDebugEnabled()) { - s_logger.debug("LocalStoragePoolAllocator returning " + suitablePools.size() + " suitable storage pools"); + if (logger.isDebugEnabled()) { + logger.debug("LocalStoragePoolAllocator returning " + suitablePools.size() + " suitable storage pools"); } return suitablePools; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java index 7a10966..229bc68 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java @@ -23,7 +23,6 @@ import java.util.Map; import javax.inject.Inject; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; @@ -41,7 +40,6 @@ import com.cloud.vm.VirtualMachineProfile; @Component public class ZoneWideStoragePoolAllocator extends AbstractStoragePoolAllocator { - private static final Logger s_logger = Logger.getLogger(ZoneWideStoragePoolAllocator.class); @Inject PrimaryDataStoreDao _storagePoolDao; @Inject @@ -50,18 +48,18 @@ public class ZoneWideStoragePoolAllocator extends AbstractStoragePoolAllocator { @Override protected List<StoragePool> select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { - s_logger.debug("ZoneWideStoragePoolAllocator to find storage pool"); + logger.debug("ZoneWideStoragePoolAllocator to find storage pool"); if (dskCh.useLocalStorage()) { return null; } - if (s_logger.isTraceEnabled()) { + if (logger.isTraceEnabled()) { // Log the pools details that are ignored because they are in disabled state List<StoragePoolVO> disabledPools = _storagePoolDao.findDisabledPoolsByScope(plan.getDataCenterId(), null, null, ScopeType.ZONE); if (disabledPools != null && !disabledPools.isEmpty()) { for (StoragePoolVO pool : disabledPools) { - s_logger.trace("Ignoring pool " + pool + " as it is in disabled state."); + logger.trace("Ignoring pool " + pool + " as it is in disabled state."); } } } @@ -114,8 +112,8 @@ public class ZoneWideStoragePoolAllocator extends AbstractStoragePoolAllocator { long dcId = plan.getDataCenterId(); List<Long> poolIdsByVolCount = _volumeDao.listZoneWidePoolIdsByVolumeCount(dcId, account.getAccountId()); - if (s_logger.isDebugEnabled()) { - s_logger.debug("List of pools in ascending order of number of volumes for account id: " + account.getAccountId() + " is: " + poolIdsByVolCount); + if (logger.isDebugEnabled()) { + logger.debug("List of pools in ascending order of number of volumes for account id: " + account.getAccountId() + " is: " + poolIdsByVolCount); } // now filter the given list of Pools by this ordered list http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java index 6e36514..47ebd27 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/datastore/provider/DataStoreProviderManagerImpl.java @@ -30,7 +30,6 @@ import java.util.concurrent.CopyOnWriteArrayList; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.api.response.StorageProviderResponse; @@ -48,7 +47,6 @@ import com.cloud.utils.component.Registry; @Component public class DataStoreProviderManagerImpl extends ManagerBase implements DataStoreProviderManager, Registry<DataStoreProvider> { - private static final Logger s_logger = Logger.getLogger(DataStoreProviderManagerImpl.class); List<DataStoreProvider> providers; protected Map<String, DataStoreProvider> providerMap = new ConcurrentHashMap<String, DataStoreProvider>(); @@ -123,18 +121,18 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto String providerName = provider.getName(); if (providerMap.get(providerName) != null) { - s_logger.debug("Did not register data store provider, provider name: " + providerName + " is not unique"); + logger.debug("Did not register data store provider, provider name: " + providerName + " is not unique"); return false; } - s_logger.debug("registering data store provider:" + provider.getName()); + logger.debug("registering data store provider:" + provider.getName()); providerMap.put(providerName, provider); try { boolean registrationResult = provider.configure(copyParams); if (!registrationResult) { providerMap.remove(providerName); - s_logger.debug("Failed to register data store provider: " + providerName); + logger.debug("Failed to register data store provider: " + providerName); return false; } @@ -146,7 +144,7 @@ public class DataStoreProviderManagerImpl extends ManagerBase implements DataSto imageStoreProviderMgr.registerDriver(provider.getName(), (ImageStoreDriver)provider.getDataStoreDriver()); } } catch (Exception e) { - s_logger.debug("configure provider failed", e); + logger.debug("configure provider failed", e); providerMap.remove(providerName); return false; } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/src/org/apache/cloudstack/storage/db/ObjectInDataStoreDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/db/ObjectInDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/db/ObjectInDataStoreDaoImpl.java index a492e76..4b13c10 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/db/ObjectInDataStoreDaoImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/db/ObjectInDataStoreDaoImpl.java @@ -21,7 +21,6 @@ import java.util.Map; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore; @@ -36,7 +35,6 @@ import com.cloud.utils.db.UpdateBuilder; @Component public class ObjectInDataStoreDaoImpl extends GenericDaoBase<ObjectInDataStoreVO, Long> implements ObjectInDataStoreDao { - private static final Logger s_logger = Logger.getLogger(ObjectInDataStoreDaoImpl.class); private SearchBuilder<ObjectInDataStoreVO> updateStateSearch; @Override @@ -69,7 +67,7 @@ public class ObjectInDataStoreDaoImpl extends GenericDaoBase<ObjectInDataStoreVO builder.set(vo, "updated", new Date()); int rows = update(vo, sc); - if (rows == 0 && s_logger.isDebugEnabled()) { + if (rows == 0 && logger.isDebugEnabled()) { ObjectInDataStoreVO dbVol = findByIdIncludingRemoved(vo.getId()); if (dbVol != null) { StringBuilder str = new StringBuilder("Unable to update ").append(vo.toString()); @@ -102,7 +100,7 @@ public class ObjectInDataStoreDaoImpl extends GenericDaoBase<ObjectInDataStoreVO .append("; updatedTime=") .append(oldUpdatedTime); } else { - s_logger.debug("Unable to update objectIndatastore: id=" + vo.getId() + ", as there is no such object exists in the database anymore"); + logger.debug("Unable to update objectIndatastore: id=" + vo.getId() + ", as there is no such object exists in the database anymore"); } } return rows > 0; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java index 142cd66..2505266 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/SnapshotDataStoreDaoImpl.java @@ -25,7 +25,6 @@ import java.util.Map; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore; @@ -46,7 +45,6 @@ import com.cloud.utils.db.UpdateBuilder; @Component public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO, Long> implements SnapshotDataStoreDao { - private static final Logger s_logger = Logger.getLogger(SnapshotDataStoreDaoImpl.class); private SearchBuilder<SnapshotDataStoreVO> updateStateSearch; private SearchBuilder<SnapshotDataStoreVO> storeSearch; private SearchBuilder<SnapshotDataStoreVO> destroyedSearch; @@ -140,7 +138,7 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO builder.set(dataObj, "updated", new Date()); int rows = update(dataObj, sc); - if (rows == 0 && s_logger.isDebugEnabled()) { + if (rows == 0 && logger.isDebugEnabled()) { SnapshotDataStoreVO dbVol = findByIdIncludingRemoved(dataObj.getId()); if (dbVol != null) { StringBuilder str = new StringBuilder("Unable to update ").append(dataObj.toString()); @@ -173,7 +171,7 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO .append("; updatedTime=") .append(oldUpdatedTime); } else { - s_logger.debug("Unable to update objectIndatastore: id=" + dataObj.getId() + ", as there is no such object exists in the database anymore"); + logger.debug("Unable to update objectIndatastore: id=" + dataObj.getId() + ", as there is no such object exists in the database anymore"); } } return rows > 0; @@ -234,7 +232,7 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO } } } catch (SQLException e) { - s_logger.debug("Failed to find latest snapshot for volume: " + volumeId + " due to: " + e.toString()); + logger.debug("Failed to find latest snapshot for volume: " + volumeId + " due to: " + e.toString()); } return null; } @@ -255,7 +253,7 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO } } } catch (SQLException e) { - s_logger.debug("Failed to find oldest snapshot for volume: " + volumeId + " due to: " + e.toString()); + logger.debug("Failed to find oldest snapshot for volume: " + volumeId + " due to: " + e.toString()); } return null; } @@ -278,7 +276,7 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO } } } catch (SQLException e) { - s_logger.debug("Failed to find parent snapshot: " + e.toString()); + logger.debug("Failed to find parent snapshot: " + e.toString()); } return null; } @@ -326,14 +324,14 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO List<SnapshotDataStoreVO> snapshots = listBy(sc); // create an entry for each record, but with empty install path since the content is not yet on region-wide store yet if (snapshots != null) { - s_logger.info("Duplicate " + snapshots.size() + " snapshot cache store records to region store"); + logger.info("Duplicate " + snapshots.size() + " snapshot cache store records to region store"); for (SnapshotDataStoreVO snap : snapshots) { SnapshotDataStoreVO snapStore = findByStoreSnapshot(DataStoreRole.Image, storeId, snap.getSnapshotId()); if (snapStore != null) { - s_logger.info("There is already entry for snapshot " + snap.getSnapshotId() + " on region store " + storeId); + logger.info("There is already entry for snapshot " + snap.getSnapshotId() + " on region store " + storeId); continue; } - s_logger.info("Persisting an entry for snapshot " + snap.getSnapshotId() + " on region store " + storeId); + logger.info("Persisting an entry for snapshot " + snap.getSnapshotId() + " on region store " + storeId); SnapshotDataStoreVO ss = new SnapshotDataStoreVO(); ss.setSnapshotId(snap.getSnapshotId()); ss.setDataStoreId(storeId); @@ -377,7 +375,7 @@ public class SnapshotDataStoreDaoImpl extends GenericDaoBase<SnapshotDataStoreVO sc.setParameters("destroyed", false); List<SnapshotDataStoreVO> snaps = listBy(sc); if (snaps != null) { - s_logger.info("Update to cache store role for " + snaps.size() + " entries in snapshot_store_ref"); + logger.info("Update to cache store role for " + snaps.size() + " entries in snapshot_store_ref"); for (SnapshotDataStoreVO snap : snaps) { snap.setRole(DataStoreRole.ImageCache); update(snap.getId(), snap); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java index 066503b..7f63261 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java @@ -26,7 +26,6 @@ import java.util.Map; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; @@ -56,7 +55,6 @@ import com.cloud.utils.exception.CloudRuntimeException; @Component public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO, Long> implements TemplateDataStoreDao { - private static final Logger s_logger = Logger.getLogger(TemplateDataStoreDaoImpl.class); private SearchBuilder<TemplateDataStoreVO> updateStateSearch; private SearchBuilder<TemplateDataStoreVO> storeSearch; private SearchBuilder<TemplateDataStoreVO> cacheSearch; @@ -174,7 +172,7 @@ public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO } int rows = update(dataObj, sc); - if (rows == 0 && s_logger.isDebugEnabled()) { + if (rows == 0 && logger.isDebugEnabled()) { TemplateDataStoreVO dbVol = findByIdIncludingRemoved(dataObj.getId()); if (dbVol != null) { StringBuilder str = new StringBuilder("Unable to update ").append(dataObj.toString()); @@ -207,7 +205,7 @@ public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO .append("; updatedTime=") .append(oldUpdatedTime); } else { - s_logger.debug("Unable to update objectIndatastore: id=" + dataObj.getId() + ", as there is no such object exists in the database anymore"); + logger.debug("Unable to update objectIndatastore: id=" + dataObj.getId() + ", as there is no such object exists in the database anymore"); } } return rows > 0; @@ -457,7 +455,7 @@ public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO List<TemplateDataStoreVO> tmpls = listBy(sc); // create an entry for each template record, but with empty install path since the content is not yet on region-wide store yet if (tmpls != null) { - s_logger.info("Duplicate " + tmpls.size() + " template cache store records to region store"); + logger.info("Duplicate " + tmpls.size() + " template cache store records to region store"); for (TemplateDataStoreVO tmpl : tmpls) { long templateId = tmpl.getTemplateId(); VMTemplateVO template = _tmpltDao.findById(templateId); @@ -465,15 +463,15 @@ public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO throw new CloudRuntimeException("No template is found for template id: " + templateId); } if (template.getTemplateType() == TemplateType.SYSTEM) { - s_logger.info("No need to duplicate system template since it will be automatically downloaded while adding region store"); + logger.info("No need to duplicate system template since it will be automatically downloaded while adding region store"); continue; } TemplateDataStoreVO tmpStore = findByStoreTemplate(storeId, tmpl.getTemplateId()); if (tmpStore != null) { - s_logger.info("There is already entry for template " + tmpl.getTemplateId() + " on region store " + storeId); + logger.info("There is already entry for template " + tmpl.getTemplateId() + " on region store " + storeId); continue; } - s_logger.info("Persisting an entry for template " + tmpl.getTemplateId() + " on region store " + storeId); + logger.info("Persisting an entry for template " + tmpl.getTemplateId() + " on region store " + storeId); TemplateDataStoreVO ts = new TemplateDataStoreVO(); ts.setTemplateId(tmpl.getTemplateId()); ts.setDataStoreId(storeId); @@ -508,7 +506,7 @@ public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO sc.setParameters("destroyed", false); List<TemplateDataStoreVO> tmpls = listBy(sc); if (tmpls != null) { - s_logger.info("Update to cache store role for " + tmpls.size() + " entries in template_store_ref"); + logger.info("Update to cache store role for " + tmpls.size() + " entries in template_store_ref"); for (TemplateDataStoreVO tmpl : tmpls) { tmpl.setDataStoreRole(DataStoreRole.ImageCache); update(tmpl.getId(), tmpl); @@ -537,7 +535,7 @@ public class TemplateDataStoreDaoImpl extends GenericDaoBase<TemplateDataStoreVO txn.commit(); } catch (Exception e) { txn.rollback(); - s_logger.warn("Failed expiring download urls for dcId: " + dcId, e); + logger.warn("Failed expiring download urls for dcId: " + dcId, e); } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java index d01ec41..bab9e2d 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java @@ -25,7 +25,6 @@ import java.util.Map; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; @@ -48,7 +47,6 @@ import com.cloud.utils.db.UpdateBuilder; @Component public class VolumeDataStoreDaoImpl extends GenericDaoBase<VolumeDataStoreVO, Long> implements VolumeDataStoreDao { - private static final Logger s_logger = Logger.getLogger(VolumeDataStoreDaoImpl.class); private SearchBuilder<VolumeDataStoreVO> updateStateSearch; private SearchBuilder<VolumeDataStoreVO> volumeSearch; private SearchBuilder<VolumeDataStoreVO> storeSearch; @@ -141,7 +139,7 @@ public class VolumeDataStoreDaoImpl extends GenericDaoBase<VolumeDataStoreVO, Lo } int rows = update(dataObj, sc); - if (rows == 0 && s_logger.isDebugEnabled()) { + if (rows == 0 && logger.isDebugEnabled()) { VolumeDataStoreVO dbVol = findByIdIncludingRemoved(dataObj.getId()); if (dbVol != null) { StringBuilder str = new StringBuilder("Unable to update ").append(dataObj.toString()); @@ -174,7 +172,7 @@ public class VolumeDataStoreDaoImpl extends GenericDaoBase<VolumeDataStoreVO, Lo .append("; updatedTime=") .append(oldUpdatedTime); } else { - s_logger.debug("Unable to update objectIndatastore: id=" + dataObj.getId() + ", as there is no such object exists in the database anymore"); + logger.debug("Unable to update objectIndatastore: id=" + dataObj.getId() + ", as there is no such object exists in the database anymore"); } } return rows > 0; @@ -281,14 +279,14 @@ public class VolumeDataStoreDaoImpl extends GenericDaoBase<VolumeDataStoreVO, Lo } // create an entry for each record, but with empty install path since the content is not yet on region-wide store yet if (vols != null) { - s_logger.info("Duplicate " + vols.size() + " volume cache store records to region store"); + logger.info("Duplicate " + vols.size() + " volume cache store records to region store"); for (VolumeDataStoreVO vol : vols) { VolumeDataStoreVO volStore = findByStoreVolume(storeId, vol.getVolumeId()); if (volStore != null) { - s_logger.info("There is already entry for volume " + vol.getVolumeId() + " on region store " + storeId); + logger.info("There is already entry for volume " + vol.getVolumeId() + " on region store " + storeId); continue; } - s_logger.info("Persisting an entry for volume " + vol.getVolumeId() + " on region store " + storeId); + logger.info("Persisting an entry for volume " + vol.getVolumeId() + " on region store " + storeId); VolumeDataStoreVO vs = new VolumeDataStoreVO(); vs.setVolumeId(vol.getVolumeId()); vs.setDataStoreId(storeId); @@ -337,7 +335,7 @@ public class VolumeDataStoreDaoImpl extends GenericDaoBase<VolumeDataStoreVO, Lo txn.commit(); } catch (Exception e) { txn.rollback(); - s_logger.warn("Failed expiring download urls for dcId: " + dcId, e); + logger.warn("Failed expiring download urls for dcId: " + dcId, e); } } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/engine/storage/src/org/apache/cloudstack/storage/volume/db/TemplatePrimaryDataStoreDaoImpl.java ---------------------------------------------------------------------- diff --git a/engine/storage/src/org/apache/cloudstack/storage/volume/db/TemplatePrimaryDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/volume/db/TemplatePrimaryDataStoreDaoImpl.java index 75838b0..76f7f25 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/volume/db/TemplatePrimaryDataStoreDaoImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/volume/db/TemplatePrimaryDataStoreDaoImpl.java @@ -20,7 +20,6 @@ package org.apache.cloudstack.storage.volume.db; import java.util.Date; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine; @@ -36,7 +35,6 @@ import com.cloud.utils.db.UpdateBuilder; @Component public class TemplatePrimaryDataStoreDaoImpl extends GenericDaoBase<TemplatePrimaryDataStoreVO, Long> implements TemplatePrimaryDataStoreDao { - private static final Logger s_logger = Logger.getLogger(TemplatePrimaryDataStoreDaoImpl.class); protected final SearchBuilder<TemplatePrimaryDataStoreVO> updateSearchBuilder; public TemplatePrimaryDataStoreDaoImpl() { @@ -81,7 +79,7 @@ public class TemplatePrimaryDataStoreDaoImpl extends GenericDaoBase<TemplatePrim builder.set(vo, "lastUpdated", new Date()); int rows = update(vo, sc); - if (rows == 0 && s_logger.isDebugEnabled()) { + if (rows == 0 && logger.isDebugEnabled()) { TemplatePrimaryDataStoreVO template = findByIdIncludingRemoved(vo.getId()); if (template != null) { StringBuilder str = new StringBuilder("Unable to update ").append(vo.toString()); @@ -114,7 +112,7 @@ public class TemplatePrimaryDataStoreDaoImpl extends GenericDaoBase<TemplatePrim .append("; updatedTime=") .append(oldUpdatedTime); } else { - s_logger.debug("Unable to update template: id=" + vo.getId() + ", as there is no such template exists in the database anymore"); + logger.debug("Unable to update template: id=" + vo.getId() + ", as there is no such template exists in the database anymore"); } } return rows > 0; http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3818257a/framework/cluster/src/com/cloud/cluster/ClusterFenceManagerImpl.java ---------------------------------------------------------------------- diff --git a/framework/cluster/src/com/cloud/cluster/ClusterFenceManagerImpl.java b/framework/cluster/src/com/cloud/cluster/ClusterFenceManagerImpl.java index 3860ad4..c921f7f 100644 --- a/framework/cluster/src/com/cloud/cluster/ClusterFenceManagerImpl.java +++ b/framework/cluster/src/com/cloud/cluster/ClusterFenceManagerImpl.java @@ -23,7 +23,6 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import com.cloud.utils.component.ManagerBase; @@ -31,7 +30,6 @@ import com.cloud.utils.component.ManagerBase; @Component @Local(value = {ClusterFenceManager.class}) public class ClusterFenceManagerImpl extends ManagerBase implements ClusterFenceManager, ClusterManagerListener { - private static final Logger s_logger = Logger.getLogger(ClusterFenceManagerImpl.class); @Inject ClusterManager _clusterMgr; @@ -52,7 +50,7 @@ public class ClusterFenceManagerImpl extends ManagerBase implements ClusterFence @Override public void onManagementNodeIsolated() { - s_logger.error("Received node isolation notification, will perform self-fencing and shut myself down"); + logger.error("Received node isolation notification, will perform self-fencing and shut myself down"); System.exit(SELF_FENCING_EXIT_CODE); } }
