Spring-Boot logging with log4j2?

后端 未结 3 1709
挽巷
挽巷 2021-02-07 08:26

I\'m using spring-boot-starter, and would like to configure log4j2.xml to log asynchron + different content to different logfiles.

I created th

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 08:39

    This is what worked for me. Having two additional exclusions. Else Application was not picking up log4j and was had conflict

    Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]

    
        org.mybatis.spring.boot
        mybatis-spring-boot-starter
        1.0.0
        
            
                org.springframework.boot
                spring-boot-starter-logging
            
            
                logback-classic
                ch.qos.logback
            
            
                log4j-over-slf4j
                org.slf4j
                        
                   
    
    
    
        org.springframework.boot
        spring-boot-starter-log4j2
    
    

提交回复
热议问题