Controlling the classpath in a servlet

后端 未结 6 464
陌清茗
陌清茗 2020-12-03 09:02

My servlet application includes a number of library .jars, some of which contain embedded log4j.xml or log4j.properties files. I\'d like to ensure that log4j finds my log4j.

6条回答
  •  北海茫月
    2020-12-03 09:46

    We the Spring Log4jConfigListener in our web.xml file.

    You can specify as a context parameter the location of the log4j config file, i.e. you could set it as /WEB-INF/log4j.xml

    Would this be an option for you? If you're not using Spring I know that you can set the Log4j location programatically which might also work.

提交回复
热议问题