-Dlogback.configurationFile=logback.xml ignored when running Spring-Boot

后端 未结 8 772
太阳男子
太阳男子 2020-12-23 19:57

We have a spring-boot 1.0.RC1 application, with logback configured for logging and a logback.xml file in src/test/resources. When we run spring-boot from maven, the logback

8条回答
  •  天涯浪人
    2020-12-23 20:23

    The default strategy assumes that if you don't have a logback.xml (or one of the other standard file names) in the classpath then you must be happy with the defaults (see LogbackLoggingSystem for details). Spring Boot tries to unify the external configuration switches for common logging sytems, so it looks in logging.config (it didn't know about logback.configurationFile). You could use that instead (i.e. logging.config=file:./src/test/resources/logback.xml), or make sure your config file is on the classpath.

提交回复
热议问题