拦截来自 Ant 的 Commons 日志记录
我试图弄清楚如何使 org.apache.commons.digester.Digester 更安静。我在构建时使用 Ant 将 JRXML 文件编译为 jasper 文件(JasperReports 报告)。我在类路径上有 logback.xml 和 slf4j 和 jcl-over-slf4j 可用。我只是无法弄清楚接线。
问题是我有 200 多个报告,在编译它们时,Digester 正在记录 DEBUG 消息,导致 55M 日志文件和太多噪音,无法找到任何实际错误。我真的只是想抑制 DEBUG 消息。任何帮助将不胜感激。
日志片段:
[jrc] 09:56:51.525 [main] DEBUG o.a.commons.digester.Digester.sax - setDocumentLocator(org.apache.xerces.parsers.AbstractSAXParser$LocatorProxy@543a586d)
[jrc] 09:56:51.525 [main] DEBUG o.a.commons.digester.Digester.sax - startDocument()
[jrc] 09:56:51.998 [main] DEBUG o.a.commons.digester.Digester.sax - startElement(,jasperReport,jasperReport)
[jrc] 09:56:51.998 [main] DEBUG org.apache.commons.digester.Digester - Pushing body text ''
[jrc] 09:56:51.999 [main] DEBUG org.apache.commons.digester.Digester - New match='jasperReport'
[jrc] 09:56:51.999 [main] DEBUG org.apache.commons.digester.Digester - Fire begin() for FactoryCreateRule
Ant 片段:
<taskdef name="jrc" classname="net.sf.jasperreports.ant.JRAntCompileTask" classpathref="jasper.reports.path"/>
<jrc tempdir="${temp.dir}" destdir="${project.classes}">
<classpath refid="libs.path" />
<classpath refid="compile.class.path" />
<src>
<fileset dir="${project.jasper.dir}">
<include name="*.jrxml"/>
</fileset>
</src>
</jrc>
I'm trying to figure out how to make org.apache.commons.digester.Digester be quieter. I am compiling JRXML files into jasper files (JasperReports reports) at build time using Ant. I have a logback.xml and slf4j and jcl-over-slf4j available on the classpath. I just can't figure out the wiring.
The problem is I have 200+ reports and when compiling them, the Digester is logging DEBUG messages, causing 55M log files and too much noise to find any actual errors. I really just want to suppress the DEBUG messages. Any help would be most appreciated.
Log snippet:
[jrc] 09:56:51.525 [main] DEBUG o.a.commons.digester.Digester.sax - setDocumentLocator(org.apache.xerces.parsers.AbstractSAXParser$LocatorProxy@543a586d)
[jrc] 09:56:51.525 [main] DEBUG o.a.commons.digester.Digester.sax - startDocument()
[jrc] 09:56:51.998 [main] DEBUG o.a.commons.digester.Digester.sax - startElement(,jasperReport,jasperReport)
[jrc] 09:56:51.998 [main] DEBUG org.apache.commons.digester.Digester - Pushing body text ''
[jrc] 09:56:51.999 [main] DEBUG org.apache.commons.digester.Digester - New match='jasperReport'
[jrc] 09:56:51.999 [main] DEBUG org.apache.commons.digester.Digester - Fire begin() for FactoryCreateRule
Ant snippet:
<taskdef name="jrc" classname="net.sf.jasperreports.ant.JRAntCompileTask" classpathref="jasper.reports.path"/>
<jrc tempdir="${temp.dir}" destdir="${project.classes}">
<classpath refid="libs.path" />
<classpath refid="compile.class.path" />
<src>
<fileset dir="${project.jasper.dir}">
<include name="*.jrxml"/>
</fileset>
</src>
</jrc>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的类路径上有 jcl-over-slf4j jar、slf4j jar 和 logback jar,那么类路径中包含 logback.xml 文件也应该连接公共日志记录以通过 logback 运行。包含如下内容将降低日志级别并最小化输出。
If you have the jcl-over-slf4j jar, the slf4j jar, and the logback jar on your classpath, including a logback.xml file in the classpath also should wire up the commons logging to run through logback. Including something like the below will reduce the log level and minimize output.