我在<代码>logback-sring.xml上有变数,我希望利用指挥线提供的价值,超越其违约价值。
<property name="log_root" value="${log.root:-logapp/logs}"/>
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log_root}/app.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log_root}/archived/app.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- keep 30 days worth of history, but at most 1GB -->
<totalSizeCap>1GB</totalSizeCap>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder>
<pattern>%level %d [%thread] %logger{15} - %msg %ex{2}%nopex%n</pattern>
</encoder>
</appender>
我试图在杰尔呼吁中推翻价值:
java -jar app.jar -Dlog.root=logappv2/logs
But the app always use the default log.root value. What is possibly the cause?