Spring Profiles, different Log4j2 configs

后端 未结 6 1518
生来不讨喜
生来不讨喜 2020-12-05 19:58

In my application.yml I got:

logging: 
  config: classpath:log4j2.debug.yml

And some others in different profiles. When I start the Applica

6条回答
  •  感情败类
    2020-12-05 20:35

    You application.yml seems to be correctly configured. Maybe the problem was because you need to add the dependencies jackson-databind and jackson-dataformat-yaml to your pom in order to use log4j2.yml.

    In case you have a spring-boot-starter-web, jackson-databind is already imported, you only need jackson-dataformat-yaml:

    
      
      
        com.fasterxml.jackson.core
        jackson-databind
      
    
      
        com.fasterxml.jackson.dataformat
        jackson-dataformat-yaml
      
    
    

提交回复
热议问题