Initializing Log4J with Spring?

前端 未结 5 1974
说谎
说谎 2020-11-28 06:30

I have a web app that uses Spring\'s Log4jConfigurer class to initialize my Log4J log factory. Basically it initializes Log4J with a config file that is off th

5条回答
  •  天涯浪人
    2020-11-28 07:13

    You could configure your Log4j listener in the web.xml instead of the spring-context.xml

    
        log4jConfigLocation
        /WEB-INF/classes/log4j.web.properties
    
    
    
        org.springframework.web.util.Log4jConfigListener
    
    

    So it is up before Spring starts.

提交回复
热议问题