tomcat启动的时候报“warn no appenders could be found for logger ...."错的原因

每次tomcat启动的时候都报这个错误,但是log4j已经配置好了,今天查了一下资料,原来是在tomcat/common/lib下多放了一个log4j的包的原因

 

原文:

Did you put a copy of log4j.jar back into common/lib?  That error is coming
from commons-logging finding Log4j and using it in preference to j2sdk1.4.x
logging, but if Log4j doesn't, then, find its configuration, you will get
that error.  Note that commons-logging does a bunch of classloading
trickery to find and load external logging packages.  It is entirely
possible that it might be using the context class loader to find Log4j,
thus being able to bypass the normal Java2 classloader hierarchy (where
only classloader higher in the hierarchy are visible).  However, I just
tested having log4j.jar in my WEB-INF/lib and not in common/lib and
commons-logging in common/lib couldn't see it (and, therefore, didn't get
the Log4j error), so it is most likely that you have log4j.jar in
common/lib (or shared/lib) or some other place where commons-logging in
Tomcat can see log4j.jar.  Remove Log4j.jar and you won't see that
error....or, I suppose, you could add log4j.xml or log4j.properties to
common/classes and all would be well.
 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值