logging.java
976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.cnlive.shenhe.logging;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
/**
* @Auther: 李伟
* @Date: 2019/08/13 10:43
* @Description:log实时日志
*/
@Controller
@RequestMapping("/logging")
public class logging {
private final Logger logger = LoggerFactory.getLogger(this.getClass());
/**
* 端口
*/
@Value("${server.port}")
private String port;
/**
* 跳转实时日志
*/
@GetMapping("/")
public ModelAndView logging( Model model) {
model.addAttribute("port", port);
logger.info("port", port);
return new ModelAndView("logging/logging.html");
}
}