catalina日志填充了自定义log4j Appender的假ClassNotFoundException,其他一切正常

时间:2013-08-07 11:21:24

标签: log4j

我在tomcat服务器的catalina.out中收到错误

:ERROR Could not create an Appender. Reported error follows.
java.lang.ClassNotFoundException: org.apache.cloudstack.syslog.AlertsSyslogAppender
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
         at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:186)
        at org.apache.log4j.helpers.Loader.loadClass(Loader.java:198)
        at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:247)
         at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)
         at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)
         at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)
         at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436)
         at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:999)
         at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:867)
         at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:755)
         at org.apache.log4j.xml.XMLWatchdog.doOnChange(DOMConfigurator.java:1120)
         at org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:89)
         at org.apache.log4j.helpers.FileWatchdog.<init>(FileWatchdog.java:58)
        at org.apache.log4j.xml.XMLWatchdog.<init>(DOMConfigurator.java:1112)
        at org.apache.log4j.xml.DOMConfigurator.configureAndWatch(DOMConfigurator.java:735)
         at org.apache.log4j.xml.DOMConfigurator.configureAndWatch(DOMConfigurator.java:718)
         at com.cloud.utils.LogUtils.initLog4j(LogUtils.java:32)
        at com.cloud.bridge.service.EC2MainServlet.init(EC2MainServlet.java:66)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) 

功能明智一切正常,即我的自定义appender被调用并执行在自定义appender中编写的内容。但是在catalina.out上面,如果我在log4j.xml中进行了一些修改,那么错误消息会定期出现。可能是什么错误。

1 个答案:

答案 0 :(得分:0)

log4j配置提及org.apache.cloudstack.syslog.AlertsSyslogAppender但相关的jarapache-cloudstack)不在classpath