088-log日志文件打印?

1.login需要一个插件lombok

2.log直接就使用了,并没有创建对象,应该是因为我们的注解

@Controller
@Slf4j
public class UserController {
    @Autowired
    private StudentService studentService;

    @RequestMapping(value = "/user/detail")
    public @ResponseBody Object userDetail(Integer id) {
        log.info("用户标识:"+id);
        //输出语句打印的日志无法打印到文件中
        System.out.println("用户id舍得离开对方就" + id);
        Student student = studentService.queryStudentById(id);
        return student;
    }
}
原文地址:https://www.cnblogs.com/pogusanqian/p/12758476.html