Wie mache ich logback Lesen eine properties-Datei, die name ist eine variable?

Ich bin mit http://logback.qos.ch/

Ich bin mit meinem java-Prozess mit parameter beispielsweise -Dproperties.url=myappproperties-production.properties oder -Dproperties.url=myappproperties-development.properties je nach environemnt ist es in.

Problem: wie logback abholen meine properties-Datei?

Wenn die Eigenschaften-Datei-name ist statisch, die ich tun würde (funktioniert):

<configuration>
    <property resource="myappproperties-development.properties" />
    (...)
</configuration>

Aber ich brauche etwas, das dynamisch ist (dies nicht funktioniert):

<configuration>
    <property resource="${properties.url}" />
    (...)
</configuration>

InformationsquelleAutor Wojtek B. | 2012-06-19

Schreibe einen Kommentar