码迷,mamicode.com
首页 > 移动开发 > 详细

log4j:WARN No appenders could be found for logger

时间:2015-04-27 20:13:47      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:

新建一个log4j.properties文件,内容如下

# Configure logging for testing: optionally with log file
log4j.rootLogger=WARN, stdout
# log4j.rootLogger=WARN, stdout, logfile
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
log4j.appender.logfile=org.apache.log4j.FileAppender
log4j.appender.logfile.File=target/spring.log
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=%d %p [%c] - %m%n

然后把 log4j.properties配置到web.xml中,不要忘了配置log4j的监听器。


log4j:WARN No appenders could be found for logger

标签:

原文地址:http://blog.csdn.net/u010286751/article/details/45314129

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!