use of org.ovirt.engine.core.common.AuditLogType in project ovirt-engine by oVirt.
the class UpgradeOvirtNodeInternalCommand method getAuditLogTypeValue.
@Override
public AuditLogType getAuditLogTypeValue() {
AuditLogType result = null;
if (getSucceeded()) {
result = AuditLogType.VDS_INSTALL;
} else {
// In case of failure - add to audit log the error as achieved from
// the host
addCustomValue("FailedInstallMessage", getErrorMessage(_failureMessage));
result = AuditLogType.VDS_INSTALL_FAILED;
}
return result;
}
use of org.ovirt.engine.core.common.AuditLogType in project ovirt-engine by oVirt.
the class VdsDeploy method userVisibleLog.
@Override
public void userVisibleLog(Level level, String message) {
if (!_alertLog) {
super.userVisibleLog(level, message);
} else {
AuditLogType type = _levelToType.get(level);
if (type == null) {
log.debug(message);
} else {
AuditLogable logable = new AuditLogableImpl();
logable.setVdsId(getVds().getId());
logable.setVdsName(getVds().getName());
logable.setClusterId(getVds().getClusterId());
logable.setClusterName(getVds().getClusterName());
logable.setCorrelationId(getCorrelationId());
logable.addCustomValue("Message", message);
Injector.get(AuditLogDirector.class).log(logable, _levelToType.get(level));
}
}
}
use of org.ovirt.engine.core.common.AuditLogType in project ovirt-engine by oVirt.
the class AuditLogableBaseTest method auditLogTypeValue.
@Test
public void auditLogTypeValue() {
final AuditLogType t = b.getAuditLogTypeValue();
assertEquals(AuditLogType.UNASSIGNED, t);
}
use of org.ovirt.engine.core.common.AuditLogType in project ovirt-engine by oVirt.
the class VdsManager method logChangeStatusToConnecting.
private void logChangeStatusToConnecting() {
long timeoutToFence = calcTimeoutToFence(cachedVds.getVmCount(), cachedVds.getSpmStatus());
String msg;
AuditLogType auditLogType;
if (cachedVds.isPmEnabled()) {
msg = "Host '{}' is not responding. It will stay in Connecting state for a grace period " + "of {} seconds and after that an attempt to fence the host will be issued.";
auditLogType = AuditLogType.VDS_HOST_NOT_RESPONDING_CONNECTING;
log.warn(msg, cachedVds.getName(), TimeUnit.MILLISECONDS.toSeconds(timeoutToFence));
} else {
msg = "Host '{}' is not responding.";
auditLogType = AuditLogType.VDS_HOST_NOT_RESPONDING;
log.warn(msg, cachedVds.getName());
}
AuditLogable logable = createAuditLogableForHost(cachedVds);
logable.addCustomValue("Seconds", Long.toString(TimeUnit.MILLISECONDS.toSeconds(timeoutToFence)));
auditLogDirector.log(logable, auditLogType);
}
use of org.ovirt.engine.core.common.AuditLogType in project ovirt-engine by oVirt.
the class MoveImageGroupCommand method addAuditLogOnRemoveFailure.
private void addAuditLogOnRemoveFailure() {
addCustomValue("DiskAlias", getDiskImage().getDiskAlias());
addCustomValue("StorageDomainName", getStorageDomain().getStorageName());
AuditLogType logType = null;
if (getActionState() == CommandActionState.END_SUCCESS) {
logType = AuditLogType.USER_MOVE_IMAGE_GROUP_FAILED_TO_DELETE_SRC_IMAGE;
} else {
logType = AuditLogType.USER_MOVE_IMAGE_GROUP_FAILED_TO_DELETE_DST_IMAGE;
}
auditLogDirector.log(this, logType);
}
Aggregations