diff --git a/agent/src/main/resources/logback-common.xml b/agent/src/main/resources/logback-common.xml index e2c98f0c1..c2930901d 100644 --- a/agent/src/main/resources/logback-common.xml +++ b/agent/src/main/resources/logback-common.xml @@ -46,6 +46,9 @@ + + ${logging.console.level:-WARN} + 20 256 true @@ -62,16 +65,12 @@ + - - - - - \ No newline at end of file diff --git a/center/src/main/resources/logback-common.xml b/center/src/main/resources/logback-common.xml index a63351c99..7b1b71179 100644 --- a/center/src/main/resources/logback-common.xml +++ b/center/src/main/resources/logback-common.xml @@ -46,6 +46,9 @@ + + ${logging.console.level:-WARN} + 20 256 true @@ -62,16 +65,12 @@ + - - - - - \ No newline at end of file diff --git a/common/src/main/java/com/microsoft/hydralab/common/management/listener/impl/PreInstallListener.java b/common/src/main/java/com/microsoft/hydralab/common/management/listener/impl/PreInstallListener.java index 3a137aa65..e678ab1d7 100644 --- a/common/src/main/java/com/microsoft/hydralab/common/management/listener/impl/PreInstallListener.java +++ b/common/src/main/java/com/microsoft/hydralab/common/management/listener/impl/PreInstallListener.java @@ -49,13 +49,13 @@ public void onDeviceConnected(DeviceInfo deviceInfo) { if (!appFile.isFile()) { continue; } - try { - // install app - deviceDriverManager.installApp(deviceInfo, appFile.getAbsolutePath(), classLogger); + + // install app + if (deviceDriverManager.installApp(deviceInfo, appFile.getAbsolutePath(), classLogger)) { classLogger.info("Pre-Install {} successfully", appFile.getAbsolutePath()); - } catch (Exception e) { + } else { String errorMessage = String.format("Pre-Install %s failed", appFile.getAbsolutePath()); - classLogger.error(errorMessage, e); + classLogger.warn(errorMessage); try { FlowUtil.retryAndSleepWhenFalse(3, 10, () -> { // try to uninstall app first @@ -64,17 +64,17 @@ public void onDeviceConnected(DeviceInfo deviceInfo) { if (!StringUtils.isEmpty(res.getString(StorageFileInfo.ParserKey.PKG_NAME))) { deviceDriverManager.uninstallApp(deviceInfo, res.getString(StorageFileInfo.ParserKey.PKG_NAME), classLogger); } - } catch (Exception e1) { + } catch (Exception e) { classLogger.warn("Uninstall origin app of {} failed", appFile.getName(), e); } // install app return deviceDriverManager.installApp(deviceInfo, appFile.getAbsolutePath(), classLogger); }); - } catch (Exception e2) { - classLogger.warn("Uninstall origin app of {} failed", appFile.getName(), e2); + } catch (Exception e1) { + classLogger.warn("Uninstall origin app of {} failed", appFile.getName(), e1); if (Const.PreInstallFailurePolicy.SHUTDOWN.equals( agentManagementService.getPreInstallFailurePolicy())) { - throw new HydraLabRuntimeException(HttpStatus.INTERNAL_SERVER_ERROR.value(), errorMessage, e2); + throw new HydraLabRuntimeException(HttpStatus.INTERNAL_SERVER_ERROR.value(), errorMessage, e1); } } }