After customizing the log4j configuration file path, deployment can only be done in the form of folders (war exploded mode). if deployment is done in the way of war, errors will occur. why? ? ?

  java, question

I set up a custom log4jConfigLocation in web.xml

<!  --Log4J configuration->
 <context-param>
 <param-name>webAppRootKey</param-name>
 <param-value>DPCM.root</param-value>
 </context-param>
 
 <context-param>
 <param-name>log4jConfigLocation</param-name>
 <param-value>classpath:conf/log/log4j.xml</param-value>
 </context-param>
 
 <context-param>
 <param-name>log4jRefreshInterval</param-name>
 <param-value>60000</param-value>
 </context-param>
 
 <listener>
 <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
 </listener>

Run in Intellij IDEA
Using war exploded mode, that is, deployment in folder mode, can start normally.
However, if you deploy in war mode, you will get an error prompt.

log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
 log4j:WARN Please initialize the log4j system properly.
 log4j:WARN See  http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

It is estimated that the problem should be this place:

<context-param>
 <param-name>log4jConfigLocation</param-name>
 <param-value>classpath:conf/log/log4j.xml</param-value>
 </context-param>

The configuration is loaded in classpath.conf/log/log4j.xmlLog4j files of the path can be deployed in the form of folders, files corresponding to the classpath can be found, but cannot be found by war deployment. Therefore, it is suggested thatSee if the packed war contains the specified classpath path file..