Roy Golan has uploaded a new change for review. Change subject: core: [logging] Remove redundant VDS in logs ......................................................................
core: [logging] Remove redundant VDS in logs also minor log cleanups Change-Id: Id51e00d565e9e6de60d0780217e23dff027ca2f3 Signed-off-by: Roy Golan <[email protected]> --- M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java 2 files changed, 20 insertions(+), 41 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/58/16558/1 diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java index 02d1719..6124bfd 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java @@ -222,7 +222,7 @@ _vds = DbFacade.getInstance().getVdsDao().get(getVdsId()); MDC.put("vds", _vds.toString()); if (_vds == null) { - log.errorFormat("VdsManager::refreshVdsRunTimeInfo - OnTimer is NULL for {0}", + log.errorFormat("OnTimer is NULL for {0}", getVdsId()); return; } @@ -243,7 +243,7 @@ } if (!getInitialized() && _vds.getStatus() != VDSStatus.NonResponsive && _vds.getStatus() != VDSStatus.PendingApproval) { - log.infoFormat("Initializing Host: {0}", _vds.getName()); + log.infoFormat("Initializing"); ResourceManager.getInstance().HandleVdsFinishedInit(_vds.getId()); setInitialized(true); } @@ -301,15 +301,11 @@ } private void logFailureMessage(RuntimeException ex) { - log.warnFormat( - "Failed to refresh VDS , vds = {0} : {1}, error = '{2}', continuing.", - _vds.getId(), - _vds.getName(), - ex); + log.warnFormat("Failed to refresh info - error = '{0}', continuing.", ex); } private static void logException(final RuntimeException ex) { - log.error("ResourceManager::refreshVdsRunTimeInfo", ex); + log.error(ex); } private void logAfterRefreshFailureMessage(RuntimeException ex) { @@ -336,10 +332,7 @@ logable.updateCallStackFromThrowable(ex); AuditLogDirector.log(logable, AuditLogType.VDS_INITIALIZING); log.warnFormat( - "Failed to refresh VDS , vds = {0} : {1}, error = {2}, continuing.", - _vds.getId(), - _vds.getName(), - ex.getMessage()); + "Failed to refresh VDS, error = {0}, continuing.", ex.getMessage()); final int VDS_RECOVERY_TIMEOUT_IN_MINUTES = Config.<Integer> GetValue(ConfigValues.VdsRecoveryTimeoutInMintues); String jobId = SchedulerUtilQuartzImpl.getInstance().scheduleAOneTimeJob(this, "onTimerHandleVdsRecovering", new Class[0], new Object[0], VDS_RECOVERY_TIMEOUT_IN_MINUTES, TimeUnit.MINUTES); @@ -364,10 +357,8 @@ setIsSetNonOperationalExecuted(true); } catch (RuntimeException exp) { log.errorFormat( - "HandleVdsRecoveringException::Error in recovery timer treatment, vds = {0} : {1}, error = {2}.", - vds.getId(), - vds.getName(), - exp.getMessage()); + "HandleVdsRecoveringException::Error in recovery timer treatment, error = {0}.", + exp.getMessage()); } } } @@ -395,8 +386,7 @@ try { refreshHost(vds); } catch (Exception e) { - log.infoFormat("Failed to activate VDS = {0} with error: {1}.", - getVdsId(), e.getMessage()); + log.infoFormat("Failed to activate VDS with error: {0}.", e.getMessage()); } return vds; @@ -410,9 +400,7 @@ VDSStatus newStatus = refreshCapabilities(new AtomicBoolean(), vds); if (log.isDebugEnabled()) { log.debugFormat( - "Succeeded to refreshCapabilities for host {0} , new status will be {1} ", - getVdsId(), - newStatus); + "Succeeded to refreshCapabilities, new status will be {0} ", newStatus); } } finally { if (vds != null) { @@ -502,8 +490,7 @@ setStatus(VDSStatus.Up, vds); DbFacade.getInstance().getVdsDynamicDao().updateStatus(getVdsId(), VDSStatus.Up); } - log.infoFormat("OnVdsDuringFailureTimer of vds {0} entered. Attempts after {1}", vds.getName(), - mFailedToRunVmAttempts); + log.infoFormat("OnVdsDuringFailureTimer entered. Attempts after {0}", mFailedToRunVmAttempts); } } @@ -519,7 +506,7 @@ logable.addCustomValue("Time", Config.<Integer> GetValue(ConfigValues.TimeToReduceFailedRunOnVdsInMinutes) .toString()); AuditLogDirector.log(logable, AuditLogType.VDS_FAILED_TO_RUN_VMS); - log.infoFormat("Vds {0} moved to Error mode after {1} attempts. Time: {2}", vds.getName(), + log.infoFormat("Vds moved to Error mode after {0} attempts. Time: {1}", mFailedToRunVmAttempts, new java.util.Date()); } } @@ -533,7 +520,7 @@ } public VDSStatus refreshCapabilities(AtomicBoolean processHardwareCapsNeeded, VDS vds) { - log.debug("GetCapabilitiesVDSCommand started method"); + log.debug("refreshing capabilities"); VDS oldVDS = vds.clone(); GetCapabilitiesVDSCommand<VdsIdAndVdsVDSCommandParametersBase> vdsBrokerCommand = new GetCapabilitiesVDSCommand<VdsIdAndVdsVDSCommandParametersBase>(new VdsIdAndVdsVDSCommandParametersBase(vds)); @@ -567,7 +554,7 @@ if (returnStatus != VDSStatus.NonOperational) { if (log.isDebugEnabled()) { log.debugFormat( - "refreshCapabilities:GetCapabilitiesVDSCommand vds {0} networks do not match its cluster networks, vds will be moved to NonOperational", + "networks do not match its cluster networks, vds will be moved to NonOperational", vds.getStaticData().getId()); } vds.setStatus(VDSStatus.NonOperational); @@ -600,7 +587,7 @@ } throw vdsBrokerCommand.getVDSReturnValue().getExceptionObject(); } else { - log.errorFormat("refreshCapabilities:GetCapabilitiesVDSCommand failed with no exception!"); + log.errorFormat("GetCapabilitiesVDSCommand failed with no exception!"); throw new RuntimeException(vdsBrokerCommand.getVDSReturnValue().getExceptionString()); } } @@ -650,9 +637,9 @@ } setStatus(VDSStatus.NonResponsive, vds); log.infoFormat( - "Server failed to respond, vds_id = {0}, vds_name = {1}, vm_count = {2}, " + - "spm_status = {3}, non-responsive_timeout (seconds) = {4}, error = {5}", - vds.getId(), vds.getName(), vds.getVmCount(), vds.getSpmStatus(), + "Host failed to respond, vm_count = {0}, " + + "spm_status = {1}, non-responsive_timeout (seconds) = {2}, error = {3}", + vds.getVmCount(), vds.getSpmStatus(), TimeUnit.MILLISECONDS.toSeconds(timeoutToFence), ex.getMessage()); AuditLogableBase logable = new AuditLogableBase(vds.getId()); @@ -685,17 +672,11 @@ break; case NonResponsive: log.debugFormat( - "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}", - _vds.getId(), - _vds.getName(), - e.getMessage()); + "Failed to refresh VDS , VDS Network Error, continuing.\n{0}", e.getMessage()); break; default: log.warnFormat( - "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}", - _vds.getId(), - _vds.getName(), - e.getMessage()); + "Failed to refresh VDS , VDS Network Error, continuing.\n{0}", e.getMessage()); } } diff --git a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java index 9645921..6d94a2a 100644 --- a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java +++ b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsUpdateRunTimeInfo.java @@ -1717,9 +1717,7 @@ _saveVdsDynamic = true; _saveVdsStatistics = true; log.infoFormat( - "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds = {0} : {1}", - _vds.getId(), - _vds.getName()); + "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database"); } } -- To view, visit http://gerrit.ovirt.org/16558 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id51e00d565e9e6de60d0780217e23dff027ca2f3 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Roy Golan <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
