Logback教程:类中使用 作者:马育民 • 2021-10-19 17:38 • 阅读:10049 ``` package top.malaoshi.mapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class Mapper { static final Logger log= LoggerFactory.getLogger(Mapper.class); public static void test(){ String content="测试:abc 123 中文"; log.trace("trace级别:: {}-{}",content); log.debug("debug级别:: {}-{}",content); log.info("info级别:: {}-{}",content); log.warn("warn级别:: {}-{}",content); log.error("error级别:: {}-{}",content); } } ``` 原文出处:http://malaoshi.top/show_1IX24RXotT3h.html