Spring中使用LOG4J
Spring中使用LOG4J 1.在web.xml中添加上下文初始化参数
<context-param> <param-name>webAppRootKey</param-name> <param-value>path</param-value> </context-param> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>/WEB-INF/log4j.properties</param-value> </context-param>
2.添加日志监听器
<listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener>
3.添加log4j.properties文件
获取日志文件输入路径${path}/WEB-INF
相关推荐
chw0 2020-11-04
大唐帝国前营 2020-08-18
sdaq 2020-07-26
MrLiar 2020-07-07
sdaq 2020-06-16
CXC0 2020-06-14
丨Fanny丨Cri 2020-06-13
CXC0 2020-06-08
dongxurr 2020-06-07
sdaq 2020-06-06
MrLiar 2020-06-04
丨Fanny丨Cri 2020-06-03
MrLiar 2020-05-25
丨Fanny丨Cri 2020-05-17
MrLiar 2020-05-14
MrLiar 2020-05-12
sdaq 2020-05-11