Skip to content

Commit a8dc748

Browse files
committed
Adjusts logs
1 parent fec27f9 commit a8dc748

File tree

15 files changed

+20
-22
lines changed

15 files changed

+20
-22
lines changed

api/src/main/java/com/cloud/agent/api/storage/OVFHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ private void writeDocumentToFile(String newOvfFilePath, Document doc) {
501501
outfile.write(writer.toString());
502502
outfile.close();
503503
} catch (IOException | TransformerException e) {
504-
logger.info("Unexpected exception caught while rewriting OVF:{}", e.getMessage(), e);
504+
logger.info("Unexpected exception caught while rewriting OVF: {}", e.getMessage(), e);
505505
throw new CloudRuntimeException(e);
506506
}
507507
}
@@ -767,7 +767,7 @@ private Integer getIntValueFromString(String value) {
767767
try {
768768
return Integer.parseInt(value);
769769
} catch (NumberFormatException e) {
770-
logger.debug("Could not parse the value: {} ignoring it", value);
770+
logger.debug("Could not parse the value: {}, ignoring it", value);
771771
}
772772
}
773773
return null;

api/src/main/java/org/apache/cloudstack/api/command/admin/host/UpdateHostCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public void execute() {
147147
this.setResponseObject(hostResponse);
148148
} catch (Exception e) {
149149
Host host = _entityMgr.findById(Host.class, getId());
150-
logger.debug("Failed to update host: {} with id {}", host, getId(), e);
150+
logger.debug("Failed to update {}", host, e);
151151
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, String.format("Failed to update host: %s with id %d, %s", host, getId(), e.getMessage()));
152152
}
153153
}

api/src/main/java/org/apache/cloudstack/api/command/admin/vlan/CreateVlanIpRangeCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public void execute() throws ResourceUnavailableException, ResourceAllocationExc
237237
logger.warn("Exception: ", ex);
238238
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, ex.getMessage());
239239
} catch (InsufficientCapacityException ex) {
240-
logger.info(ex);
240+
logger.error(ex);
241241
throw new ServerApiException(ApiErrorCode.INSUFFICIENT_CAPACITY_ERROR, ex.getMessage());
242242
}
243243
}

api/src/main/java/org/apache/cloudstack/api/command/admin/vm/ImportUnmanagedInstanceCmd.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public Map<String, Long> getNicNetworkList() {
201201
for (Map<String, String> entry : (Collection<Map<String, String>>)nicNetworkList.values()) {
202202
String nic = entry.get(VmDetailConstants.NIC);
203203
String networkUuid = entry.get(VmDetailConstants.NETWORK);
204-
logger.debug("nic, '{}', goes on net, '{}'", nic, networkUuid);
204+
logger.debug("Checking if NIC '{}' can be mapped on network '{}'", nic, networkUuid);
205205
if (StringUtils.isAnyEmpty(nic, networkUuid) || _entityMgr.findByUuid(Network.class, networkUuid) == null) {
206206
throw new InvalidParameterValueException(String.format("Network ID: %s for NIC ID: %s is invalid", networkUuid, nic));
207207
}
@@ -217,7 +217,7 @@ public Map<String, Network.IpAddresses> getNicIpAddressList() {
217217
for (Map<String, String> entry : (Collection<Map<String, String>>)nicIpAddressList.values()) {
218218
String nic = entry.get(VmDetailConstants.NIC);
219219
String ipAddress = StringUtils.defaultIfEmpty(entry.get(VmDetailConstants.IP4_ADDRESS), null);
220-
logger.debug("nic, '{}', gets ip, '{}'", nic, ipAddress);
220+
logger.debug("Checking if IP address '{}' can be mapped to NIC '{}'", ipAddress, nic);
221221
if (StringUtils.isEmpty(nic)) {
222222
throw new InvalidParameterValueException(String.format("NIC ID: '%s' is invalid for IP address mapping", nic));
223223
}
@@ -240,7 +240,7 @@ public Map<String, Long> getDataDiskToDiskOfferingList() {
240240
for (Map<String, String> entry : (Collection<Map<String, String>>)dataDiskToDiskOfferingList.values()) {
241241
String disk = entry.get(VmDetailConstants.DISK);
242242
String offeringUuid = entry.get(VmDetailConstants.DISK_OFFERING);
243-
logger.trace("disk, '{}', gets offering, '{}'", disk, offeringUuid);
243+
logger.trace("Checking if offering '{}' can be user on disk '{}'", offeringUuid, disk);
244244
if (StringUtils.isAnyEmpty(disk, offeringUuid) || _entityMgr.findByUuid(DiskOffering.class, offeringUuid) == null) {
245245
throw new InvalidParameterValueException(String.format("Disk offering ID: %s for disk ID: %s is invalid", offeringUuid, disk));
246246
}

api/src/main/java/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public Map<String, List<String>> getServiceProviders() {
224224
Iterator<? extends Map<String, String>> iter = servicesCollection.iterator();
225225
while (iter.hasNext()) {
226226
Map<String, String> obj = iter.next();
227-
logger.trace("service provider entry specified: ", () -> obj);
227+
logger.trace("Service provider entry specified: ", obj);
228228
HashMap<String, String> services = (HashMap<String, String>)obj;
229229
String service = services.get("service");
230230
String provider = services.get("provider");

api/src/main/java/org/apache/cloudstack/api/command/user/backup/ListBackupsCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void execute() throws ResourceUnavailableException, InsufficientCapacityE
148148
Pair<List<Backup>, Integer> result = backupManager.listBackups(this);
149149
setupResponseBackupList(result.first(), result.second());
150150
} catch (Exception e) {
151-
logger.debug("Exception while listing backups", e);
151+
logger.error("Exception while listing backups", e);
152152
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
153153
}
154154
}

api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public void create() {
255255
}
256256
} catch (NetworkRuleConflictException ex) {
257257
String message = "Network rule conflict: ";
258-
logger.info( "Network rule conflict: {}", ex.getMessage());
258+
logger.error( "Network rule conflict: {}", ex.getMessage());
259259
logger.trace(message, ex);
260260
throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage());
261261
}

api/src/main/java/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public void create() {
271271
setEntityUuid(result.getUuid());
272272
}
273273
} catch (NetworkRuleConflictException ex) {
274-
logger.trace("Network Rule Conflict: ", ex);
274+
logger.error("Network Rule Conflict: ", ex);
275275
throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, ex.getMessage(), ex);
276276
}
277277
}

api/src/main/java/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void create() {
148148
setEntityId(rule.getId());
149149
setEntityUuid(rule.getUuid());
150150
} catch (NetworkRuleConflictException e) {
151-
logger.info("Unable to create static NAT rule due to ", e);
151+
logger.error("Unable to create static NAT rule due to ", e);
152152
throw new ServerApiException(ApiErrorCode.NETWORK_RULE_CONFLICT_ERROR, e.getMessage());
153153
}
154154
}

api/src/main/java/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public long getEntityOwnerId() {
128128
} else {
129129
account = CallContext.current().getCallingAccount();
130130
if (!Account.Type.ADMIN.equals(account.getType())) {
131-
logger.warn("Only Root Admin can create global ACLs. Account [{}] cannot create any global ACL.", account);
131+
logger.error("Only Root Admin can create global ACLs. {} cannot create any global ACL.", account);
132132
throw new PermissionDeniedException("Only Root Admin can create global ACLs.");
133133
}
134134

0 commit comments

Comments
 (0)