第1种 private Logger logger = LoggerFactory.getLogger(UserService.class); 第2种 @Slf 引入依赖: idea 安装lombok插件 使用