在變量替換期間logback是否讀取環境變量?我在應用程序啓動過程中在控制檯上獲得了REM_HOME_IS_UNDEFINED。雖然變量存在。手冊說env變量在食物鏈中最後被查找。 http://logback.qos.ch/manual/configuration.html#variableSubstitution無法讀取logback中的env變量
下面是我在做什麼:
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${REM_HOME}/reac/logs/reac.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<fileNamePattern>${REM_HOME}/reac/logs/archives/reac-%i.log.zip</fileNamePattern>
<minIndex>1</minIndex>
<maxIndex>3</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>5MB</maxFileSize>
</triggeringPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %logger{36} %-5level - %msg%n</pattern>
</encoder>
</appender>