I am using http://logback.qos.ch/
I am running my java process with a parameter for example -Dproperties.url=myappproperties-production.properties
or -Dproperties.url=myappproperties-development.properties
depending on the environemnt it is run in.
Problem: how to make logback pick up my properties file?
If the properties file name is static I would do (works fine):
<configuration>
<property resource="myappproperties-development.properties" />
(...)
</configuration>
But I need something that is dynamic (this does not work):
<configuration>
<property resource="${properties.url}" />
(...)
</configuration>
The value of the resource file can be a property itself. In other words,
<configuration debug="true">
<property resource="${properties.url}" />
(...)
</configuration>
should work. BYW, set the debug
attribute of <configuration>
element to true
to see logback's internal messages on the console. Which version of logback are you using?
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