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


##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1397,17 +1412,17 @@ public void cleanupStorage(boolean recurring) {
                                     // expunge volume from secondary if volume 
is on image store
                                     VolumeInfo volOnSecondary = 
volFactory.getVolume(volume.getId(), DataStoreRole.Image);
                                     if (volOnSecondary != null) {
-                                        s_logger.info("Expunging volume " + 
volume.getUuid() + " uploaded using HTTP POST from secondary data store");
+                                        s_logger.info(String.format("Expunging 
volume [%s] uploaded using HTTP POST from secondary data store.", 
volume.getUuid()));
                                         AsyncCallFuture<VolumeApiResult> 
future = volService.expungeVolumeAsync(volOnSecondary);
                                         VolumeApiResult result = future.get();
                                         if (!result.isSuccess()) {
-                                            s_logger.warn("Failed to expunge 
volume " + volume.getUuid() + " from the image store " + dataStore.getName() + 
" due to: " + result.getResult());
+                                            
s_logger.warn(String.format("Failed to expunge volume [%s] from the image store 
[%s] due to: [%s].", volume.getUuid(), dataStore.getName(), 
result.getResult()));
                                         }
                                     }
                                 }
                             }
                         } catch (Throwable th) {
-                            s_logger.warn("Unable to destroy uploaded volume " 
+ volume.getUuid() + ". Error details: " + th.getMessage());
+                            s_logger.error(String.format("Unable to destroy 
uploaded volume [%s] due to: [%s].", volume.getUuid(), th.getMessage()), th);

Review Comment:
   ```suggestion
                               s_logger.error(String.format("Unable to destroy 
uploaded volume [%s] due to: [%s].", volume.getUuid(), th.getMessage()));
                               s_logger.error(String.format("Unable to destroy 
uploaded volume [%s].", volume.getUuid()), th);
   ```



##########
server/src/main/java/com/cloud/storage/StorageManagerImpl.java:
##########
@@ -1397,17 +1412,17 @@ public void cleanupStorage(boolean recurring) {
                                     // expunge volume from secondary if volume 
is on image store
                                     VolumeInfo volOnSecondary = 
volFactory.getVolume(volume.getId(), DataStoreRole.Image);
                                     if (volOnSecondary != null) {
-                                        s_logger.info("Expunging volume " + 
volume.getUuid() + " uploaded using HTTP POST from secondary data store");
+                                        s_logger.info(String.format("Expunging 
volume [%s] uploaded using HTTP POST from secondary data store.", 
volume.getUuid()));
                                         AsyncCallFuture<VolumeApiResult> 
future = volService.expungeVolumeAsync(volOnSecondary);
                                         VolumeApiResult result = future.get();
                                         if (!result.isSuccess()) {
-                                            s_logger.warn("Failed to expunge 
volume " + volume.getUuid() + " from the image store " + dataStore.getName() + 
" due to: " + result.getResult());
+                                            
s_logger.warn(String.format("Failed to expunge volume [%s] from the image store 
[%s] due to: [%s].", volume.getUuid(), dataStore.getName(), 
result.getResult()));
                                         }
                                     }
                                 }
                             }
                         } catch (Throwable th) {
-                            s_logger.warn("Unable to destroy uploaded volume " 
+ volume.getUuid() + ". Error details: " + th.getMessage());
+                            s_logger.error(String.format("Unable to destroy 
uploaded volume [%s] due to: [%s].", volume.getUuid(), th.getMessage()), th);

Review Comment:
   ```suggestion
                               s_logger.error(String.format("Unable to destroy 
uploaded volume [%s] due to: [%s].", volume.getUuid(), th.getMessage()));
                               s_logger.debug(String.format("Unable to destroy 
uploaded volume [%s].", volume.getUuid()), th);
   ```



-- 
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