title: How to change log4j2 logging path on tomcat?
body: <p>I'm running a webapp on <code>tomcat</code> using <code>spring-boot</code>.</p>
  
  <p>How could I change the <code>log4j2.xml</code> logging path dynamically? (eg by jvm args, property file, or else)?</p>
  
  <p>So far I configured the log xml as follows:</p>
  
  <pre><code>&lt;Configuration&gt;
      &lt;Properties&gt;
          &lt;property name="path"&gt;${bundle:application:log.path}&lt;/property&gt;
      &lt;/Properties&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>With configuration file:</p>
  
  <pre><code>#application.properties:
  log.path=d:/
  </code></pre>
  
  <p>Now I want to dynamically force the logpath to eg <code>d:/log-test</code>, but without having to modify my <code>war</code> file. Because on redeployment I would lose any manual configuration.</p>
  
  <p>So how could I provide a different logging path?</p>
  
  <p>I want to run multiple profiles on the same machine, so environment or system properties are of no use for me here.</p>