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

后端 未结 8 740
太阳男子
太阳男子 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

    According to Spring Boot documentation, you could run like this:

    java -jar app.jar --logging.config=./src/test/resources/logback.xml
    

    Additionally, Spring Boot tries to unify the properties name of the different log startegies. As a result, the JVM parameter Dlogback.configurationFile is not used for Spring Boot.

    0 讨论(0)
  • 2020-12-23 20:23

    If logback xml is under resources folder, you can add following to VM option:

    java -jar App.jar -Dlogging.config=classpath:logback-local.xml
    
    0 讨论(0)
提交回复
热议问题