自定义log4j.properties的加载位置
- 自定义log4j.properties的加载位置
jar方式运行:
String configPathPrefix = "D:/conf/";
PropertyConfigurator.configure(configPathPrefix + "log4j.properties");
一般的web方式:
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>
WEB-INF/classes/log/log4j.properties
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>