Following is my log4j2.xml file. I am trying to put my log files in tomcat. But here it is picking ${catalina.base} literally and creating a folder with the same name i.e ${catalina.base} in the current directory. I have also checked ${catalina.base} is set and it is returning the proper value if I am using a .properties file. How can I get the value of ${catalina.base} in log4j2.xml. Any help is appreciated. I am stuck on it.
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="trace">
<Properties>
<Property name="log-path" >${catalina.base}</Property>
</Properties>
<Appenders>
<Console name="Console"
target="SYSTEM_OUT">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %t [%t] (%F:%L) - %m%n" />
</Console>
<!--<File name="MyFile"-->
<!--append="true" immediateFlush="true"-->
<!--fileName="${log-path}/tearsLog.log">-->
<!--<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %t [%t] (%F:%L) - %m%n" />-->
<!--</File>-->
<RollingFile name="MyRollingFile"
append="true" immediateFlush="true"
fileName="${log-path}/logs/catalina.log"
filePattern="${log-path}/logs/catalina_%d{yyyy-MM-dd}.log">
<PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p %t [%t] (%F:%L) - %m%n" />
<Policies>
<TimeBasedTriggeringPolicy filePattern="${LOG_DIR}/application.%d{dd-MMM-hh}.log.gz" />
</Policies>
<DefaultRolloverStrategy max="10" />
</RollingFile>
</Appenders>
<Loggers>
<Logger name="com.visa.dp.ags.probe.api.server" level="debug" additivity="false">
<AppenderRef ref="Console" />
<!--<AppenderRef ref="MyFile" level="trace" />-->
<AppenderRef ref="MyRollingFile" />
</Logger>
<Root level="debug">
<AppenderRef ref="Console" />
<!--<AppenderRef ref="MyFile" level="trace" additivity="false" />-->
<AppenderRef ref="MyRollingFile" additivity="false" />
</Root>
</Loggers>