diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java index fab7d9eef29..02c425553d8 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java @@ -254,9 +254,8 @@ public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements Firewal setEntityUuid(result.getUuid()); } } catch (NetworkRuleConflictException ex) { - s_logger.info("Network rule conflict: " + ex.getMessage()); s_logger.trace("Network Rule Conflict: ", ex); - throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage()); + throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage(), ex); } } diff --git a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java index ea0cb00301a..ff11395ee37 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java @@ -358,9 +358,8 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P setEntityId(result.getId()); setEntityUuid(result.getUuid()); } catch (NetworkRuleConflictException ex) { - s_logger.info("Network rule conflict: ", ex); s_logger.trace("Network Rule Conflict: ", ex); - throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage()); + throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage(), ex); } } diff --git a/engine/schema/src/main/java/com/cloud/usage/dao/UsageDaoImpl.java b/engine/schema/src/main/java/com/cloud/usage/dao/UsageDaoImpl.java index 626b8ccf2be..f54db8dcd29 100644 --- a/engine/schema/src/main/java/com/cloud/usage/dao/UsageDaoImpl.java +++ b/engine/schema/src/main/java/com/cloud/usage/dao/UsageDaoImpl.java @@ -91,7 +91,7 @@ public class UsageDaoImpl extends GenericDaoBase implements Usage txn.commit(); } catch (Exception ex) { txn.rollback(); - s_logger.error("error retrieving usage vm instances for account id: " + accountId); + s_logger.error("error retrieving usage vm instances for account id: " + accountId, ex); } finally { txn.close(); } diff --git a/plugins/event-bus/rabbitmq/src/main/java/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java b/plugins/event-bus/rabbitmq/src/main/java/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java index 0b0b0839e70..b2f173e27c9 100644 --- a/plugins/event-bus/rabbitmq/src/main/java/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java +++ b/plugins/event-bus/rabbitmq/src/main/java/org/apache/cloudstack/mom/rabbitmq/RabbitMQEventBus.java @@ -237,9 +237,9 @@ public class RabbitMQEventBus extends ManagerBase implements EventBus { s_subscribers.put(queueName, queueDetails); } catch (AlreadyClosedException closedException) { - s_logger.warn("Connection to AMQP service is lost. Subscription:" + queueName + " will be active after reconnection"); + s_logger.warn("Connection to AMQP service is lost. Subscription:" + queueName + " will be active after reconnection", closedException); } catch (ConnectException connectException) { - s_logger.warn("Connection to AMQP service is lost. Subscription:" + queueName + " will be active after reconnection"); + s_logger.warn("Connection to AMQP service is lost. Subscription:" + queueName + " will be active after reconnection", connectException); } catch (Exception e) { throw new EventBusException("Failed to subscribe to event due to " + e.getMessage()); } diff --git a/plugins/hypervisors/hyperv/src/main/java/com/cloud/ha/HypervInvestigator.java b/plugins/hypervisors/hyperv/src/main/java/com/cloud/ha/HypervInvestigator.java index 222286f9165..774efc84b3a 100644 --- a/plugins/hypervisors/hyperv/src/main/java/com/cloud/ha/HypervInvestigator.java +++ b/plugins/hypervisors/hyperv/src/main/java/com/cloud/ha/HypervInvestigator.java @@ -68,7 +68,7 @@ public class HypervInvestigator extends AdapterBase implements Investigator { return answer.getResult() ? Status.Down : Status.Up; } } catch (Exception e) { - s_logger.debug("Failed to send command to host: " + neighbor.getId()); + s_logger.debug("Failed to send command to host: " + neighbor.getId(), e); } } diff --git a/plugins/hypervisors/ovm/src/main/java/com/cloud/ovm/hypervisor/OvmFencer.java b/plugins/hypervisors/ovm/src/main/java/com/cloud/ovm/hypervisor/OvmFencer.java index e671a364da6..6a247d91439 100644 --- a/plugins/hypervisors/ovm/src/main/java/com/cloud/ovm/hypervisor/OvmFencer.java +++ b/plugins/hypervisors/ovm/src/main/java/com/cloud/ovm/hypervisor/OvmFencer.java @@ -94,12 +94,12 @@ public class OvmFencer extends AdapterBase implements FenceBuilder { answer = (FenceAnswer)_agentMgr.send(h.getId(), fence); } catch (AgentUnavailableException e) { if (s_logger.isDebugEnabled()) { - s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable"); + s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable", e); } continue; } catch (OperationTimedoutException e) { if (s_logger.isDebugEnabled()) { - s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable"); + s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable", e); } continue; } diff --git a/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java b/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java index 86c28715e0b..c776edfde35 100644 --- a/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java +++ b/plugins/hypervisors/simulator/src/main/java/com/cloud/ha/SimulatorFencer.java @@ -90,12 +90,12 @@ public class SimulatorFencer extends AdapterBase implements FenceBuilder { answer = (FenceAnswer)_agentMgr.send(h.getId(), fence); } catch (AgentUnavailableException e) { if (s_logger.isDebugEnabled()) { - s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable"); + s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable", e); } continue; } catch (OperationTimedoutException e) { if (s_logger.isDebugEnabled()) { - s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable"); + s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable", e); } continue; } diff --git a/plugins/hypervisors/xenserver/src/main/java/com/cloud/ha/XenServerFencer.java b/plugins/hypervisors/xenserver/src/main/java/com/cloud/ha/XenServerFencer.java index af89a0ada66..72ec375fa27 100644 --- a/plugins/hypervisors/xenserver/src/main/java/com/cloud/ha/XenServerFencer.java +++ b/plugins/hypervisors/xenserver/src/main/java/com/cloud/ha/XenServerFencer.java @@ -77,12 +77,12 @@ public class XenServerFencer extends AdapterBase implements FenceBuilder { answer = (FenceAnswer)ans; } catch (AgentUnavailableException e) { if (s_logger.isDebugEnabled()) { - s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable"); + s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable", e); } continue; } catch (OperationTimedoutException e) { if (s_logger.isDebugEnabled()) { - s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable"); + s_logger.debug("Moving on to the next host because " + h.toString() + " is unavailable", e); } continue; } diff --git a/plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java b/plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java index 4a9001b27da..7124659a6b5 100644 --- a/plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xenserver/src/main/java/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java @@ -5028,14 +5028,14 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe checkForSuccess(conn, task); } catch (final Types.HandleInvalid e) { if (vm.getPowerState(conn) == VmPowerState.RUNNING) { - s_logger.debug("VM " + vmName + " is in Running status"); + s_logger.debug("VM " + vmName + " is in Running status", e); task = null; return; } throw new CloudRuntimeException("Start VM " + vmName + " catch HandleInvalid and VM is not in RUNNING state"); } catch (final TimeoutException e) { if (vm.getPowerState(conn) == VmPowerState.RUNNING) { - s_logger.debug("VM " + vmName + " is in Running status"); + s_logger.debug("VM " + vmName + " is in Running status", e); task = null; return; } diff --git a/server/src/main/java/com/cloud/ha/KVMFencer.java b/server/src/main/java/com/cloud/ha/KVMFencer.java index 3f06872b56f..e102bc273ac 100644 --- a/server/src/main/java/com/cloud/ha/KVMFencer.java +++ b/server/src/main/java/com/cloud/ha/KVMFencer.java @@ -99,10 +99,10 @@ public class KVMFencer extends AdapterBase implements FenceBuilder { try { answer = (FenceAnswer)_agentMgr.send(h.getId(), fence); } catch (AgentUnavailableException e) { - s_logger.info("Moving on to the next host because " + h.toString() + " is unavailable"); + s_logger.info("Moving on to the next host because " + h.toString() + " is unavailable", e); continue; } catch (OperationTimedoutException e) { - s_logger.info("Moving on to the next host because " + h.toString() + " is unavailable"); + s_logger.info("Moving on to the next host because " + h.toString() + " is unavailable", e); continue; } if (answer != null && answer.getResult()) { diff --git a/server/src/main/java/com/cloud/server/ConfigurationServerImpl.java b/server/src/main/java/com/cloud/server/ConfigurationServerImpl.java index 197ebed3e69..b970111f9ef 100644 --- a/server/src/main/java/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/main/java/com/cloud/server/ConfigurationServerImpl.java @@ -715,10 +715,10 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio kStream.write(key.getBytes()); } } catch (FileNotFoundException e) { - s_logger.warn("Failed to write key to " + keyfile.getAbsolutePath()); + s_logger.warn("Failed to write key to " + keyfile.getAbsolutePath(), e); throw new CloudRuntimeException("Failed to update keypairs on disk: cannot find key file " + keyPath); } catch (IOException e) { - s_logger.warn("Failed to write key to " + keyfile.getAbsolutePath()); + s_logger.warn("Failed to write key to " + keyfile.getAbsolutePath(), e); throw new CloudRuntimeException("Failed to update keypairs on disk: cannot write to key file " + keyPath); } }