您的位置:首页 > 其它

web项目 log4j2 指定配置文件路径

2017-06-03 15:10 411 查看
pom.xml需要额外引入的jar:

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-web</artifactId>
<scope>runtime</scope>
</dependency>

web.xml:

<context-param>
<param-name>log4jConfiguration</param-name>
<param-value>"log4j2.xml所在目录"/log4j2.xml</param-value>
</context-param>

<listener>
<listener-class>org.apache.logging.log4j.web.Log4jServletContextListener</listener-class>
</listener>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: