title: Is there a way to externalize Spring [Boot] app's log4j2 config on Tomcat?
body: <p>Our Spring Boot application uses log4j2 for logging, but the admins of the server we are going to deploy it to require that:</p>
  
  <ol>
  <li><p>the logging be fully configurable on their end, i.e., there must be a log4j2.xml file that they can edit to adjust logging formats, files, levels etc., and</p></li>
  <li><p>The configuration must <em>not</em> be lost or overridden when a new version of the app is deployed (the upload war -> stop tomcat -> delete webapp folder -> start Tomcat) process will be automated.</p></li>
  </ol>
  
  <p>Ideally, the path to <code>log4j2.xml</code> should be set in the webapps context .xml file — since that's where the DB connection config is. But I can't seem to find a way to make this work. All search results talk about using <code>META-INF/web.xml</code> or <code>application.properties</code> files (not an option, since they get overwritten on deploy), and the only SO question I could find (<a href="https://stackoverflow.com/questions/32713596/spring-application-without-web-xml-log4j-configuration">Spring application without web.xml log4j configuration</a>) did not work for me ("No Configuration was provided") exception on startup.</p>