登录    关于
马育民老师的博客

马育民的博客

QQ:65242847

Logback教程:类中使用

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