Maven中log4J的配置

Maven中添加log4J依赖


    
    
        mysql
        mysql-connector-java
        5.1.34
    
    
    
        
            org.mybatis
            mybatis
            3.2.7
        
    
    
        org.bgee.log4jdbc-log4j2
        log4jdbc-log4j2-jdbc4.1
        1.16
    
    
        org.slf4j
        slf4j-api
        1.7.13
    
    
        org.slf4j
        slf4j-log4j12
        1.7.5
    
  
  
    
        log4j
        log4j
        1.2.16
    
  

需要添加log4j.properties

# Global logging configuration
log4j.rootLogger=DEBUG, stdout
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n

你可能感兴趣的:(Maven中log4J的配置)