diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/LogServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/LogServiceImpl.java index e23c8440..ed9db4c4 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/LogServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/LogServiceImpl.java @@ -77,7 +77,7 @@ public class LogServiceImpl implements ILogService { } private File getLogDir() { - Logger logger = (Logger) LoggerFactory.getLogger("com.genersoft.iot.vmp"); + Logger logger = (Logger) LoggerFactory.getLogger("root"); RollingFileAppender rollingFileAppender = (RollingFileAppender) logger.getAppender("RollingFile"); File rollingFile = new File(rollingFileAppender.getFile()); return rollingFile.getParentFile(); diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java index 640f2b4f..b0d02eae 100755 --- a/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java +++ b/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java @@ -69,8 +69,8 @@ public class LogController { * 下载指定日志文件 */ @ResponseBody - @GetMapping("/file") - public void downloadFile(HttpServletResponse response, @RequestParam(required = true) String fileName) { + @GetMapping("/file/{fileName}") + public void downloadFile(HttpServletResponse response, @PathVariable String fileName) { try { File file = logService.getFileByName(fileName); if (file == null || !file.exists() || !file.isFile()) { diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 585e1d67..308f148b 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -55,27 +55,6 @@ - - - - - - ${LOG_HOME}/error-%d{yyyy-MM-dd}.%i.log - - 30 - 20MB - - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50}:%L - %msg%n - UTF-8 - - - - WARN - - - @@ -97,12 +76,8 @@ - - - - - +