Fix some log messages that do not match with their function (#2796)

This commit is contained in:
lzh3636 2018-08-16 03:49:43 -04:00 committed by dahn
parent f867f4a7c6
commit e57003f93f
13 changed files with 29 additions and 32 deletions

View File

@ -52,8 +52,7 @@ public class VirtualMachinePowerStateSyncImpl implements VirtualMachinePowerStat
@Override
public void processHostVmStateReport(long hostId, Map<String, HostVmStateReportEntry> report) {
if (s_logger.isDebugEnabled())
s_logger.debug("Process host VM state report from ping process. host: " + hostId);
s_logger.debug("Process host VM state report. host: " + hostId);
Map<Long, VirtualMachine.PowerState> translatedInfo = convertVmStateReport(report);
processReport(hostId, translatedInfo);

View File

@ -169,7 +169,7 @@ public class UsageDaoImpl extends GenericDaoBase<UsageVO, Long> implements Usage
txn.commit();
} catch (Exception ex) {
txn.rollback();
s_logger.error("error saving account to cloud_usage db", ex);
s_logger.error("error updating account to cloud_usage db", ex);
throw new CloudRuntimeException(ex.getMessage());
}
}
@ -237,7 +237,7 @@ public class UsageDaoImpl extends GenericDaoBase<UsageVO, Long> implements Usage
txn.commit();
} catch (Exception ex) {
txn.rollback();
s_logger.error("error saving user stats to cloud_usage db", ex);
s_logger.error("error updating user stats to cloud_usage db", ex);
throw new CloudRuntimeException(ex.getMessage());
}
}
@ -340,7 +340,7 @@ public class UsageDaoImpl extends GenericDaoBase<UsageVO, Long> implements Usage
txn.commit();
} catch (Exception ex) {
txn.rollback();
s_logger.error("error saving vm disk stats to cloud_usage db", ex);
s_logger.error("error updating vm disk stats to cloud_usage db", ex);
throw new CloudRuntimeException(ex.getMessage());
}

View File

@ -375,8 +375,8 @@ public class XenServerStorageProcessor implements StorageProcessor {
isoURL = iso.getName();
} else {
if (!(store instanceof NfsTO)) {
s_logger.debug("Can't attach a iso which is not created on nfs: ");
return new AttachAnswer("Can't attach a iso which is not created on nfs: ");
s_logger.debug("Can't detach a iso which is not created on nfs: ");
return new AttachAnswer("Can't detach a iso which is not created on nfs: ");
}
final NfsTO nfsStore = (NfsTO) store;
isoURL = nfsStore.getUrl() + nfsStore.getPathSeparator() + data.getPath();
@ -417,11 +417,11 @@ public class XenServerStorageProcessor implements StorageProcessor {
return new DettachAnswer(disk);
} catch (final XenAPIException e) {
final String msg = "Failed to dettach volume" + " for uuid: " + data.getPath() + " due to " + e.toString();
final String msg = "Failed to detach volume" + " for uuid: " + data.getPath() + " due to " + e.toString();
s_logger.warn(msg, e);
return new DettachAnswer(msg);
} catch (final Exception e) {
final String msg = "Failed to dettach volume" + " for uuid: " + data.getPath() + " due to " + e.getMessage();
final String msg = "Failed to detach volume" + " for uuid: " + data.getPath() + " due to " + e.getMessage();
s_logger.warn(msg, e);
return new DettachAnswer(msg);
}
@ -1775,7 +1775,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
vdi.forget(conn);
return new IntroduceObjectAnswer(cmd.getDataTO());
} catch (final Exception e) {
s_logger.debug("Failed to introduce object", e);
s_logger.debug("Failed to forget object", e);
return new Answer(cmd, false, e.toString());
}
}

View File

@ -389,7 +389,7 @@ public class NetScalerControlCenterResource implements ServerResource {
}
else {
if (shouldRetry(numRetries)) {
s_logger.debug("Retrying the command NetScalerImplementNetworkCommand retry count: " + numRetries );
s_logger.debug("Retrying the command NetScalerImplementNetworkCommand retry count: " + numRetries, e);
return retry(cmd, numRetries);
} else {
return new Answer(cmd, false, e.getMessage());
@ -397,7 +397,7 @@ public class NetScalerControlCenterResource implements ServerResource {
}
} catch (Exception e) {
if (shouldRetry(numRetries)) {
s_logger.debug("Retrying the command NetScalerImplementNetworkCommand retry count: " + numRetries );
s_logger.debug("Retrying the command NetScalerImplementNetworkCommand retry count: " + numRetries, e);
return retry(cmd, numRetries);
} else {
return new Answer(cmd, false, e.getMessage());

View File

@ -175,7 +175,7 @@ public abstract class Action {
String errorMessage = responseToErrorMessage(putMethod);
putMethod.releaseConnection();
s_logger.error("Failed to update object : " + errorMessage);
throw new NeutronRestApiException("Failed to create object : " + errorMessage);
throw new NeutronRestApiException("Failed to update object : " + errorMessage);
}
} catch (NeutronRestApiException e) {
s_logger.error("NeutronRestApiException caught while trying to execute HTTP Method on the Neutron Controller", e);
@ -207,7 +207,7 @@ public abstract class Action {
String errorMessage = responseToErrorMessage(putMethod);
putMethod.releaseConnection();
s_logger.error("Failed to update object : " + errorMessage);
throw new NeutronRestApiException("Failed to create object : " + errorMessage);
throw new NeutronRestApiException("Failed to update object : " + errorMessage);
}
return putMethod.getResponseBodyAsString();
@ -244,8 +244,8 @@ public abstract class Action {
if (deleteMethod.getStatusCode() != HttpStatus.SC_NO_CONTENT) {
String errorMessage = responseToErrorMessage(deleteMethod);
deleteMethod.releaseConnection();
s_logger.error("Failed to update object : " + errorMessage);
throw new NeutronRestApiException("Failed to create object : " + errorMessage);
s_logger.error("Failed to delete object : " + errorMessage);
throw new NeutronRestApiException("Failed to delete object : " + errorMessage);
}
} catch (NeutronRestApiException e) {
s_logger.error("NeutronRestApiException caught while trying to execute HTTP Method on the Neutron Controller", e);

View File

@ -513,7 +513,7 @@ StaticNatServiceProvider, IpDeployer {
final List<DomainRouterVO> routers = _routerDao.listByNetworkAndRole(
network.getId(), Role.VIRTUAL_ROUTER);
if (routers == null || routers.isEmpty()) {
s_logger.debug("Virtual router elemnt doesn't need to apply firewall rules on the backend; virtual "
s_logger.debug("Virtual router elemnt doesn't need to apply load balancing rules on the backend; virtual "
+ "router doesn't exist in the network "
+ network.getId());
return true;

View File

@ -132,7 +132,7 @@ public class OvsGuestNetworkGuru extends GuestNetworkGuru {
.findById(physicalNetworkId);
if (!canHandle(offering, nwType, physnet)) {
s_logger.debug("Refusing to design this network");
s_logger.debug("Refusing to implement this network");
return null;
}
NetworkVO implemented = (NetworkVO)super.implement(network, offering,

View File

@ -576,7 +576,7 @@ public class OvsTunnelManagerImpl extends ManagerBase implements OvsTunnelManage
Answer[] answers = _agentMgr.send(hostId, cmds);
handleSetupBridgeAnswer(answers);
} catch (OperationTimedoutException | AgentUnavailableException e) {
s_logger.warn("Ovs Tunnel network created tunnel failed", e);
s_logger.warn("Ovs Tunnel network created bridge failed", e);
}
// now that bridge is setup, populate network acl's before the VM gets created

View File

@ -295,7 +295,7 @@ public class SAMLUtils {
X509EncodedKeySpec spec = keyFactory.getKeySpec(key, X509EncodedKeySpec.class);
return new String(org.bouncycastle.util.encoders.Base64.encode(spec.getEncoded()), Charset.forName("UTF-8"));
} catch (InvalidKeySpecException e) {
s_logger.error("Unable to create KeyFactory:" + e.getMessage());
s_logger.error("Unable to get KeyFactory:" + e.getMessage());
}
return null;
}
@ -313,7 +313,7 @@ public class SAMLUtils {
PKCS8EncodedKeySpec.class);
return new String(org.bouncycastle.util.encoders.Base64.encode(spec.getEncoded()), Charset.forName("UTF-8"));
} catch (InvalidKeySpecException e) {
s_logger.error("Unable to create KeyFactory:" + e.getMessage());
s_logger.error("Unable to get KeyFactory:" + e.getMessage());
}
return null;
}
@ -332,7 +332,7 @@ public class SAMLUtils {
try {
return keyFactory.generatePublic(x509KeySpec);
} catch (InvalidKeySpecException e) {
s_logger.error("Unable to create PrivateKey from privateKey string:" + e.getMessage());
s_logger.error("Unable to create PublicKey from PublicKey string:" + e.getMessage());
}
return null;
}

View File

@ -1003,7 +1003,7 @@ public class FirewallManagerImpl extends ManagerBase implements FirewallService,
try {
success = success && applyIngressFirewallRules(ipId, _accountMgr.getSystemAccount());
} catch (ResourceUnavailableException ex) {
s_logger.warn("Failed to apply port forwarding rules for ip id=" + ipId);
s_logger.warn("Failed to apply firewall rules for ip id=" + ipId);
success = false;
}
}

View File

@ -770,8 +770,8 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
} else if (router.getState() == State.Stopped) {
s_logger.debug("Router " + router + " is in Stopped state, not sending deleteRemoteAccessVpn command to it");
} else {
s_logger.warn("Failed to delete remote access VPN: domR " + router + " is not in right state " + router.getState());
throw new ResourceUnavailableException("Failed to delete remote access VPN: domR is not in right state " + router.getState(), DataCenter.class,
s_logger.warn("Failed to stop remote access VPN: domR " + router + " is not in right state " + router.getState());
throw new ResourceUnavailableException("Failed to stop remote access VPN: domR is not in right state " + router.getState(), DataCenter.class,
router.getDataCenterId());
}
return true;

View File

@ -2496,9 +2496,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
return null;
}
if (s_logger.isDebugEnabled()) {
s_logger.debug("Propagating agent change request event:" + event.toString() + " to agent:" + agentId);
}
s_logger.debug("Propagating resource request event:" + event.toString() + " to agent:" + agentId);
final Command[] cmds = new Command[1];
cmds[0] = new PropagateResourceEventCommand(agentId, event);

View File

@ -329,15 +329,15 @@ public class CAManagerImpl extends ManagerBase implements CAManager {
try {
certificate.checkValidity(now.plusDays(CertExpiryAlertPeriod.valueIn(host.getClusterId())).toDate());
} catch (final CertificateExpiredException | CertificateNotYetValidException e) {
LOG.warn("Certificate is going to expire for " + hostDescription);
LOG.warn("Certificate is going to expire for " + hostDescription, e);
if (AutomaticCertRenewal.valueIn(host.getClusterId())) {
try {
LOG.debug("Attempting certificate auto-renewal for " + hostDescription);
LOG.debug("Attempting certificate auto-renewal for " + hostDescription, e);
boolean result = caManager.provisionCertificate(host, false, null);
if (result) {
LOG.debug("Succeeded in auto-renewing certificate for " + hostDescription);
LOG.debug("Succeeded in auto-renewing certificate for " + hostDescription, e);
} else {
LOG.debug("Failed in auto-renewing certificate for " + hostDescription);
LOG.debug("Failed in auto-renewing certificate for " + hostDescription, e);
}
} catch (final Throwable ex) {
LOG.warn("Failed to auto-renew certificate for " + hostDescription + ", with error=", ex);