为什么ContextLoaderListener要在Log4jConfigListener之后注册

Jun*_*uns 3 java spring

根据 Spring Doc API http://docs.spring.io/spring-framework/docs/current/javadoc-api/index.html?org/springframework/web/context/ContextLoaderListener.html -

这个(ContextLoaderListener)监听器应该在web.xml中的Log4jConfigListener之后注册

我不明白为什么 Log4jConfigListener 要先注册?

Kev*_*sox 5

该文档没有深入探讨他们对该订单的偏好的详细信息。我假设建议使用此顺序,以便在注册之前配置日志记录属性ContextLoaderListener,这将允许在注册期间正确记录调试消息。