除了发现和定位问题之外,我们还可以通过⽇志实现以下功能:
Spring Boot里了);在程序中获取日志对象需要使用日志工厂 LoggerFactory,如下代码所示:

package com.example.demo.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@ResponseBody
public class