I am using servlet 2.5 and i followed the instructions to set up the listeners and filters, but still my webapp complains that the configuration file cannot be found. My listener, context param,filter and filter mappings are all defined as the first values in their respective locations in my web.xml. I made sure log4j-web-2.2.jar is in my classpath as well. Are there other options to load them from a spring bean? I would like to load a different config file based on a value in catalina.properties. Can somebody please advice?
<listener>
<listener-class>org.apache.logging.log4j.web.Log4jServletContextListener</listener-class>
</listener>
<context-param>
<param-name>log4jConfiguration</param-name>
<param-value>classpath:*${sys:log4j2.xml.name}</param-value>
<filter>
<filter-name>log4jServletFilter</filter-name>
<filter-class>org.apache.logging.log4j.web.Log4jServletFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>log4jServletFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>