Log4j2无法获得环境。变量

时间:2016-04-18 12:06:17

标签: java logging log4j log4j2

我检查了很多类似的问题和文档,但仍然没有 找到任何解决方案

我有env变量。但我无法在log4j2.xml中获取此变量

<Properties>
      <Property name="logPath">${env:XP_HOME}</Property>

     <!-- <Property name="logPath">${sys:XP_HOME}</Property> -->
     <!-- <Property name="logPath">$${env:XP_HOME}</Property >-->
     ....
</Properties>

  <RollingRandomAccessFile name="LogFile"
                             append="true"
                             fileName="${logPath}/${logName}.log"
                             filePattern="${logPath}/${logName}-%d{MM-dd-yyyy}-%i.log.gz">
        ......
    </RollingRandomAccessFile>

env variable

但我也为此案例及其工作创建了测试。

enter image description here

有什么想法吗?

0 个答案:

没有答案
相关问题