logback + Slf4j注解

maven依赖:

        
            ch.qos.logback
            logback-classic
            1.4.6
        
        
            org.projectlombok
            lombok
            1.18.26
        

logback.xml



    
        
            %d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n
        
    

    
        
    

示例代码:

package org.example;


import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Main {
    public static void main(String[] args) {
        log.debug("Hello world");
    }
}

你可能感兴趣的:(log4j,logback,java,servlet)