Search code examples
javaspring-bootlog4japplication.propertiesexternalizing

How do I externalize log4j.xml,application properties and jar using spring boot?


I created a spring boot project and wanted to externalize log4j.xml, application property file and jar ,so that I can create a bat file and run the spring boot application through this command


Solution

  • java -Dlog4j.configuration=file:/temp/log4j.xml -jar temp/ltstatus.jar -Dspring.config.location=temp/application.properties

    Replace temp as your folder path