shop--13.日志 logback SLF4j
1.private final Logger logger = LoggerFactory.getLogger(当前类.class);
logger.debug("debug");
logger.info("info");
logger.error("error");
2.或者使用注解 @Slf4j
然后下面使用
log.debug("debug");
log.info("info");
log.error("error");
3. 输出参数
String name = "asd";
String password = "asds";
log.info("name: {}, password: {} ", name, password)
4.日志logback的配置
①application.yml
②logbac-spring.xml