扫码关注官方订阅号
我的项目是基于maven的web项目,应用了log4j2,在main方法中测试的是可以控制台和日志输出,但是在项目中只有控制台输出,没有日志记录,望大神指点
光阴似箭催人老,日月如移越少年。
standalone和web有些许差异
或者说题主只是忘了添加log4j-web?
<dependencies> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-web</artifactId> <version>2.1</version> <scope>runtime</scope> </dependency> </dependencies>
参考http://logging.apache.org/log4j/2.x/manual/webapp.html
配置发出来看看呢
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
standalone和web有些许差异
或者说题主只是忘了添加log4j-web?
参考http://logging.apache.org/log4j/2.x/manual/webapp.html
配置发出来看看呢