This is an automated email from the ASF dual-hosted git repository.
dahn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/main by this push:
new 1b861dad48f Cleanup: Standardize logger message formatting in
ApiServer.java (#11188)
1b861dad48f is described below
commit 1b861dad48fe4987b691eab7ed102638d5c1f550
Author: Suyang(Dawson) Chen <[email protected]>
AuthorDate: Fri Jan 9 03:30:17 2026 -0500
Cleanup: Standardize logger message formatting in ApiServer.java (#11188)
---
server/src/main/java/com/cloud/api/ApiServer.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/server/src/main/java/com/cloud/api/ApiServer.java
b/server/src/main/java/com/cloud/api/ApiServer.java
index 5a3c8c2c717..95aca28b53f 100644
--- a/server/src/main/java/com/cloud/api/ApiServer.java
+++ b/server/src/main/java/com/cloud/api/ApiServer.java
@@ -461,14 +461,14 @@ public class ApiServer extends ManagerBase implements
HttpRequestHandler, ApiSer
final Long snapshotLimit = ConcurrentSnapshotsThresholdPerHost.value();
if (snapshotLimit == null || snapshotLimit <= 0) {
- logger.debug("Global concurrent snapshot config parameter " +
ConcurrentSnapshotsThresholdPerHost.value() + " is less or equal 0; defaulting
to unlimited");
+ logger.debug("Global concurrent snapshot config parameter {} is
less or equal 0; defaulting to unlimited",
ConcurrentSnapshotsThresholdPerHost.value());
} else {
dispatcher.setCreateSnapshotQueueSizeLimit(snapshotLimit);
}
final Long migrationLimit =
VolumeApiService.ConcurrentMigrationsThresholdPerDatastore.value();
if (migrationLimit == null || migrationLimit <= 0) {
- logger.debug("Global concurrent migration config parameter " +
VolumeApiService.ConcurrentMigrationsThresholdPerDatastore.value() + " is less
or equal 0; defaulting to unlimited");
+ logger.debug("Global concurrent migration config parameter {} is
less or equal 0; defaulting to unlimited",
VolumeApiService.ConcurrentMigrationsThresholdPerDatastore.value());
} else {
dispatcher.setMigrateQueueSizeLimit(migrationLimit);
}
@@ -647,7 +647,7 @@ public class ApiServer extends ManagerBase implements
HttpRequestHandler, ApiSer
logValue = (value == null) ? "'null'" : value[0];
}
- logger.trace(" key: " + keyStr + ", value: " +
logValue);
+ logger.trace(" key: {}, value: {}", keyStr,
logValue);
}
}
throw new
ServerApiException(ApiErrorCode.UNSUPPORTED_ACTION_ERROR, "Invalid request, no
command sent");
@@ -707,7 +707,7 @@ public class ApiServer extends ManagerBase implements
HttpRequestHandler, ApiSer
buf.append(obj.getUuid());
buf.append(" ");
}
- logger.info("PermissionDenied: " + ex.getMessage() + " on
objs: [" + buf + "]");
+ logger.info("PermissionDenied: {} on objs: [{}]",
ex.getMessage(), buf);
} else {
logger.info("PermissionDenied: {}", ex.getMessage());
}
@@ -1035,7 +1035,7 @@ public class ApiServer extends ManagerBase implements
HttpRequestHandler, ApiSer
// if api/secret key are passed to the parameters
if ((signature == null) || (apiKey == null)) {
- logger.debug("Expired session, missing signature, or missing
apiKey -- ignoring request. Signature: " + signature + ", apiKey: " + apiKey);
+ logger.warn("Expired session, missing signature, or missing
apiKey -- ignoring request. Signature: {}, apiKey: {}", signature, apiKey);
return false; // no signature, bad request
}
@@ -1258,7 +1258,7 @@ public class ApiServer extends ManagerBase implements
HttpRequestHandler, ApiSer
float offsetInHrs = 0f;
if (timezone != null) {
final TimeZone t = TimeZone.getTimeZone(timezone);
- logger.info("Current user logged in under " + timezone + "
timezone");
+ logger.info("Current user logged in under {} timezone",
timezone);
final java.util.Date date = new java.util.Date();
final long longDate = date.getTime();
@@ -1410,9 +1410,9 @@ public class ApiServer extends ManagerBase implements
HttpRequestHandler, ApiSer
final Boolean apiSourceCidrChecksEnabled =
ApiServiceConfiguration.ApiSourceCidrChecksEnabled.value();
if (apiSourceCidrChecksEnabled) {
- logger.debug("CIDRs from which account '" + account.toString() +
"' is allowed to perform API calls: " + accessAllowedCidrs);
+ logger.debug("CIDRs from which account '{}' is allowed to perform
API calls: {}", account.toString(), accessAllowedCidrs);
if (!NetUtils.isIpInCidrList(remoteAddress,
accessAllowedCidrs.split(","))) {
- logger.warn("Request by account '" + account.toString() + "'
was denied since " + remoteAddress + " does not match " + accessAllowedCidrs);
+ logger.warn("Request by account '{}' was denied since {} does
not match {}", account.toString(), remoteAddress, accessAllowedCidrs);
throw new OriginDeniedException("Calls from disallowed
origin", account, remoteAddress);
}
}