logging.java 976 Bytes
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");
    }
}