Skip to content
Advertisement

Externalizing the location of logback.xml in Spring Boot using application.properties

How can I customize the location of logback.xml in Spring Boot using application.properties?

I tried below but is not working.

application.properties

JavaScript

It is working if the logback.xml is located in the resource folder, but not working if it is located outside the project.

It is also working if the I supply as an environment variable like

JavaScript

Advertisement

Answer

Below construct worked for me (but I used relative path instead of absolute):

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement