I am running my app with executable jar.
I have log4j.properties inside /resources folder
In prod I would like to override it and have it within external dir
How I could do that using Spring-Boot?
-Dlogging.config=/path/to/log4j.properties
http://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html
If you don't like to add command line arguments, you can make additional application.properties
on the directory where you start the application. like:
# log4j configuration for product
logging.config=log4j-prod.properties
Then, this application.properties
will override the /resources/application.properties
and, the log4j-prod.properties
will be used on the product environment. Please read more details on:
http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config-application-property-files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With