我已经按照BIRT FAQjava.util.logging
将 BIRT的日志记录(似乎基于
我随后制作了一个 BIRT 记录器,如下所示:
public class BirtLogger extends Handler {
private final Logger log = Logger.getLogger(BirtLogger.class);
@Override
public void publish(LogRecord record) {
Level level = record.getLevel();
String message = record.getMessage();
if (Level.SEVERE.equals(level)) {
log.fatal(message);
}
else if (Level.INFO.equals(level)) {
log.info(message);
}
else if (Level.WARNING.equals(level)) {
log.warn(message);
}
}
...
我的 logging.properties 如下所示:
#logging configuration for BIRT
handlers=com.totaalsoftware.fieldtracker.report.BirtLogger
我在三个地方使用这个配置:
- Eclipse --> 工作得很好
- Tomcat --> 工作得很好
org.apache.tomcat.maven:tomcat7-maven-plugin:2.0
--> 不工作
后者在启动时给出以下错误消息:
java.lang.ClassNotFoundException: com.totaalsoftware.fieldtracker.report.BirtLogger
java.lang.ClassNotFoundException: com.totaalsoftware.fieldtracker.report.BirtLogger
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.util.logging.LogManager$3.run(LogManager.java:418)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:405)
at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:1076)
at java.util.logging.LogManager.access$1100(LogManager.java:148)
at java.util.logging.LogManager$RootLogger.getHandlers(LogManager.java:1159)
at java.util.logging.Logger.log(Logger.java:521)
at java.util.logging.Logger.doLog(Logger.java:543)
at java.util.logging.Logger.logp(Logger.java:659)
at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:183)
at org.apache.juli.logging.DirectJDKLog.info(DirectJDKLog.java:126)
at org.apache.catalina.core.ApplicationContext.log(ApplicationContext.java:710)
at org.apache.catalina.core.ApplicationContextFacade.log(ApplicationContextFacade.java:298)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:442)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:133)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5027)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
然而,我确实相信,这个“缺失”的类在应用程序的类路径中。但是可能有一些tomcat7
我还没有完全掌握的 Maven 插件的类加载特性......
我为此搜索了很多,发现了一堆根本没有帮助我的“假定”解决方案,我现在没有想法。您的帮助将不胜感激。