解决方法:
如果注解@Slf4j注入后找不到变量log,需要IDEA安装lombok插件,装好重启解决问题。
参考:https://blog.csdn.net/ttongqiuhua/article/details/113642626