web项目 log4j2 指定配置文件路径
2017-06-03 15:10
411 查看
pom.xml需要额外引入的jar:
web.xml:
<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>
相关文章推荐
- Tomcat配置文件---配置访问指定路径下的项目
- 通过环境变量设置WEB项目数据源(Spring)及其项目配置文件路径,动态更新数据源及项目配置
- Log4j2指定配置文件路径
- tomcat部署项目(linux),指定配置文件、war包路径
- 通过环境变量设置WEB项目数据源(Spring)及其项目配置文件路径,动态更新数据源及项目配置
- Java Web 项目中的配置文件路径
- Tomcat项目发布的三种方式;一种:直接将项目(文件)直接复制到tomcat/webapps下二种:在tomcat/conf/server.xml配置tomcat的虚拟路径;
- web项目中quartz使用request获取指定的文件路径
- java web上传文件至非项目路径并配置tomcat虚拟路径进行下载
- 关于web项目log日志指定输出文件位置配置
- Java Web 项目中的配置文件路径
- tomcat部署项目,指定设置项目的配置文件路径
- 基于web项目log日志指定输出文件位置配置方法
- 关于web项目web.xml配置文件路径的问题。
- 关于web项目中的图片上传、并在前端显示问题(tomcat中配置文件上传虚拟路径)
- web项目中quartz使用request获取指定的文件路径
- Log4j2代码指定配置文件路径
- 从web项目中解析xml文件出现(\src\bean.xml (系统找不到指定的路径。))
- VS打开.net工程提示"无法读取项目文件"web.csproj",系统找不到指定路径"
- ASP.NET项目站点配置Web.Config文件【转】