mirror of https://github.com/apache/cloudstack.git
improve logging readability
This commit is contained in:
parent
44491448e3
commit
c8fce3ff31
|
|
@ -1329,7 +1329,8 @@ public class KVMStorageProcessor implements StorageProcessor {
|
|||
s_logger.info("Snapshot " + snap_full_name + " successfully removed from " +
|
||||
primaryPool.getType().toString() + " pool.");
|
||||
} catch (RbdException e) {
|
||||
s_logger.error(e.toString() + " - " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
s_logger.error("Failed to remove snapshot " + snap_full_name + ", with exception: " + e.toString() +
|
||||
", RBD error: " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
} finally {
|
||||
rbd.close(image);
|
||||
r.ioCtxDestroy(io);
|
||||
|
|
@ -1340,13 +1341,15 @@ public class KVMStorageProcessor implements StorageProcessor {
|
|||
}
|
||||
return new Answer(cmd, true, "Snapshot " + snap_full_name + " removed successfully.");
|
||||
} catch (RadosException e) {
|
||||
s_logger.error(e.toString() + " - " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
s_logger.error("Failed to remove snapshot " + snap_full_name + ", with exception: " + e.toString() +
|
||||
", RBD error: " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
return new Answer(cmd, false, "Failed to remove snapshot " + snap_full_name);
|
||||
} catch (RbdException e) {
|
||||
s_logger.error(e.toString() + " - " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
s_logger.error("Failed to remove snapshot " + snap_full_name + ", with exception: " + e.toString() +
|
||||
", RBD error: " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
return new Answer(cmd, false, "Failed to remove snapshot " + snap_full_name);
|
||||
} catch (Exception e) {
|
||||
s_logger.error(e.toString());
|
||||
s_logger.error("Failed to remove snapshot " + snap_full_name + ", with exception: " + e.toString());
|
||||
return new Answer(cmd, false, "Failed to remove snapshot " + snap_full_name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -878,6 +878,8 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
|
|||
s_logger.info("Succesfully unprotected and removed any remaining snapshots (" + snaps.size() + ") of "
|
||||
+ pool.getSourceDir() + "/" + uuid + " Continuing to remove the RBD image");
|
||||
} catch (RbdException e) {
|
||||
s_logger.error("Failed to remove snapshot with exception: " + e.toString() +
|
||||
", RBD error: " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
throw new CloudRuntimeException(e.toString() + " - " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
} finally {
|
||||
s_logger.debug("Closing image and destroying context");
|
||||
|
|
@ -885,8 +887,12 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
|
|||
r.ioCtxDestroy(io);
|
||||
}
|
||||
} catch (RadosException e) {
|
||||
s_logger.error("Failed to remove snapshot with exception: " + e.toString() +
|
||||
", RBD error: " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
throw new CloudRuntimeException(e.toString() + " - " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
} catch (RbdException e) {
|
||||
s_logger.error("Failed to remove snapshot with exception: " + e.toString() +
|
||||
", RBD error: " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
throw new CloudRuntimeException(e.toString() + " - " + ErrorCode.getErrorMessage(e.getReturnValue()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue