log4j 整合web 报错 不读取配置文件

StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console

我的log4j2.xml 文件在 resource 目录的 log4j2下

我的web.xml 配置中 添加:

<!--log4j2-->
    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>
    <context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>classpath:log4j/log4j2.xml</param-value>
    </context-param>
    <context-param>
        <param-name>log4jRefreshInterval</param-name>
        <param-value>60000</param-value>
    </context-param>

求助为何现在控制台报这个错误


ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.

阅读 3k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进