DaanHoogland commented on code in PR #9873:
URL: https://github.com/apache/cloudstack/pull/9873#discussion_r1900090613


##########
agent/src/main/java/com/cloud/agent/Agent.java:
##########
@@ -212,8 +216,9 @@ public Agent(final IAgentShell shell, final int 
localAgentId, final ServerResour
                 new ThreadPoolExecutor(_shell.getWorkers(), 5 * 
_shell.getWorkers(), 1, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>(), new 
NamedThreadFactory(
                         "agentRequest-Handler"));
 
-        logger.info("Agent [id = {} : type = {} : zone = {} : pod = {} : 
workers = {} : host = {} : port = {}", ObjectUtils.defaultIfNull(_id, "new"), 
getResourceName(),
-                 _shell.getZone(), _shell.getPod(), _shell.getWorkers(), host, 
_shell.getPort());
+        logger.info("Agent [id = {}, uuid: {}, name: {}] : type = {} : zone = 
{} : pod = {} : workers = {} : host = {} : port = {}",

Review Comment:
   ```suggestion
           logger.info("Agent [ID = {}, UUID: {}, name: {}] : type = {} : zone 
= {} : pod = {} : workers = {} : host = {} : port = {}",
   ```



##########
api/src/main/java/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotFromVMSnapshotCmd.java:
##########
@@ -164,8 +164,9 @@ public void create() throws ResourceAllocationException {
 
     @Override
     public void execute() {
-        logger.info("CreateSnapshotFromVMSnapshotCmd with vm snapshot id:" + 
getVMSnapshotId() + " and snapshot id:" + getEntityId() + " starts:" + 
System.currentTimeMillis());
-        CallContext.current().setEventDetails("Vm Snapshot Id: "+ 
this._uuidMgr.getUuid(VMSnapshot.class, getVMSnapshotId()));
+        VMSnapshot vmSnapshot = 
_vmSnapshotService.getVMSnapshotById(getVMSnapshotId());
+        logger.info("CreateSnapshotFromVMSnapshotCmd with vm snapshot {} with 
id {} and snapshot [id: {}, uuid: {}]", vmSnapshot, getVMSnapshotId(), 
getEntityId(), getEntityUuid());

Review Comment:
   ```suggestion
           logger.info("CreateSnapshotFromVMSnapshotCmd with VM snapshot {} 
with ID {} and snapshot [ID: {}, UUID: {}]", vmSnapshot, getVMSnapshotId(), 
getEntityId(), getEntityUuid());
   ```



##########
api/src/main/java/org/apache/cloudstack/api/command/admin/host/UpdateHostCmd.java:
##########
@@ -125,8 +125,9 @@ public void execute() {
             hostResponse.setResponseName(getCommandName());
             this.setResponseObject(hostResponse);
         } catch (Exception e) {
-            logger.debug("Failed to update host:" + getId(), e);
-            throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed 
to update host:" + getId() + "," + e.getMessage());
+            Host host = _entityMgr.findById(Host.class, getId());
+            logger.debug("Failed to update host: {} with id {}", host, 
getId(), e);

Review Comment:
   ```suggestion
               logger.debug("Failed to update host: {} with ID {}", host, 
getId(), e);
   ```



##########
agent/src/main/java/com/cloud/agent/Agent.java:
##########
@@ -182,8 +184,10 @@ public Agent(final IAgentShell shell, final int 
localAgentId, final ServerResour
         resource.setAgentControl(this);
 
         final String value = _shell.getPersistentProperty(getResourceName(), 
"id");
+        _uuid = _shell.getPersistentProperty(getResourceName(), "uuid");
+        _name = _shell.getPersistentProperty(getResourceName(), "name");
         _id = value != null ? Long.parseLong(value) : null;
-        logger.info("id is {}", ObjectUtils.defaultIfNull(_id, ""));
+        logger.info("Initialising agent [id: {}, uuid: {}, name: {}]", 
ObjectUtils.defaultIfNull(_id, ""), _uuid, _name);

Review Comment:
   ```suggestion
           logger.info("Initialising agent [ID: {}, UUID: {}, name: {}]", 
ObjectUtils.defaultIfNull(_id, ""), _uuid, _name);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to