title: How to read from catalina.properties in log4j2
body: <p><strong>My system configuration is:</strong>
  Tomcat 9.0.14 on Windows
  Java 8
  Spring Boot
  log4j2</p>
  
  <p><strong>In my catalina.properties, I have the following property defined:</strong></p>
  
  <pre><code>server_log_root=D:/Bharath/Projects/Logs
  </code></pre>
  
  <p><strong>In my log4j2.xml file, I am trying to access the above property as follows:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="WARN"&gt;
      &lt;Properties&gt;
          &lt;Property name="LOG_HOME"&gt;${sys:server_log_root}&lt;/Property&gt;
          &lt;Property name="CONVERSION_PATTERN"&gt;%d{yyyy-MM-dd HH:mm:ss,SSS} tId=%X{TRANSACTION_ID} %-5p %C{1}:%L - %m%n&lt;/Property&gt;
      &lt;/Properties&gt;
      &lt;Appenders&gt;
          &lt;Console name="CONSOLE_APPENDER" target="SYSTEM_OUT"&gt;
              &lt;PatternLayout pattern="${CONVERSION_PATTERN}" /&gt;
          &lt;/Console&gt;
  
          &lt;File name="API_SERVICES_FILE_APPENDER" fileName="${LOG_HOME}/api_services_log.log"&gt;
              &lt;PatternLayout pattern="${CONVERSION_PATTERN}" /&gt;
          &lt;/File&gt;
      &lt;/Appenders&gt;
      &lt;Loggers&gt;
          &lt;Root&gt;
              &lt;AppenderRef ref="CONSOLE_APPENDER" level="debug"/&gt;
          &lt;/Root&gt;
  
          &lt;Logger name="API_SERVICES_FILE_LOGGER" level="debug" additivity="false"&gt;
              &lt;AppenderRef ref="API_SERVICES_FILE_APPENDER" /&gt;
          &lt;/Logger&gt;
      &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>Upon running my application, the logs are not getting created in the folder (D:/Bharath/Projects/Logs).</p>
  
  <p>I tried changing the folder path style from / to \ but no luck still.
  <strong>Also, I tried using the following but none worked:</strong></p>
  
  <pre><code>$${sys:server_log_root}
  ${env:server_log_root}
  $${env:server_log_root}
  ${server_log_root}
  $${server_log_root}
  </code></pre>
  
  <p>Can anyone please help me?
  Thanks in advance!</p>
  
  <p>Sincerely,
  Bharath</p>