Log4j内插它在web.xml中为log4jConfiguration找到的值。但是,您必须使用标准的Log4j查找语法。要获取环境变量,您可以指定:
<context-param>
<param-name>log4jConfiguration</param-name>
<param-value>file:///${env:ENVIROMENT_VARIABLE}/log4j2.xml</param-value>
</context-param>
使用环境变量将log4j2.xml文件加载到项目外部
Log4j内插它在web.xml中为log4jConfiguration找到的值。但是,您必须使用标准的Log4j查找语法。要获取环境变量,您可以指定:
<context-param>
<param-name>log4jConfiguration</param-name>
<param-value>file:///${env:ENVIROMENT_VARIABLE}/log4j2.xml</param-value>
</context-param>