What is right way to supply initialization for log4j2 in a Spring MVC Webapp using Java Config and no web.xml?
问题 I have a Spring MVC Web App (4.0) with log4j2. This webapp uses no web.xml and takes care of configuration through Java Config. Log4j2 configuration needs to take place in an external config file, not on the classpath. In a previous incarnation with web.xml we had <context-param> <param-name>log4jConfiguration</param-name> <param-value>file:///path/to/log4j2.xml</param-value> </context-param> and this worked. In the new web.xml-less world, I tried this: public class WebappInitializer extends