Commit 0188c6e41635914ad4a35443be175845cd9a253d
1 parent
72b465ae
增加本地日志显示功能-增强yml配置
Showing
2 changed files
with
14 additions
and
1 deletions
src/main/java/com/huaheng/pc/monitor/systemLog/controller/SystemLogController.java
... | ... | @@ -2,6 +2,7 @@ package com.huaheng.pc.monitor.systemLog.controller; |
2 | 2 | |
3 | 3 | import com.huaheng.common.exception.service.ServiceException; |
4 | 4 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
5 | +import org.springframework.beans.factory.annotation.Value; | |
5 | 6 | import org.springframework.stereotype.Controller; |
6 | 7 | import org.springframework.ui.ModelMap; |
7 | 8 | import org.springframework.web.bind.annotation.GetMapping; |
... | ... | @@ -12,12 +13,21 @@ import java.io.*; |
12 | 13 | @Controller |
13 | 14 | @RequestMapping("/monitor/systemLog") |
14 | 15 | public class SystemLogController { |
15 | - private final String path = "D:\\company\\wms2\\WMSlog\\"; | |
16 | + | |
17 | + /** | |
18 | + * 此处值应为日志所在路径 | |
19 | + */ | |
20 | +// @Value("${log.path}") | |
21 | +// private String path; | |
22 | + private String path = "D:\\company\\wms2\\WMSlog"; | |
16 | 23 | private String prefix = "monitor/systemLog"; |
17 | 24 | |
25 | + | |
18 | 26 | @RequiresPermissions("monitor:systemLog:view") |
19 | 27 | @GetMapping("") |
20 | 28 | public String systemLog(ModelMap mmap){ |
29 | + path = path + "\\"; | |
30 | + System.out.println("path路径为---"+path+"-----"); | |
21 | 31 | File info = new File(path+"sys-info"); |
22 | 32 | File debug = new File(path+"sys-debug"); |
23 | 33 | File warn = new File(path+"sys-warn"); |
... | ... |