views:

21

answers:

1

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>
A: 

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.

<logger name="org.apache.commons.digester" additivity="false">
<level value="ERROR" />
<appender-ref ref="RootConsoleAppender" />
</logger>
<logger name="net.sf.jasperreports.engine" additivity="false">
<level value="ERROR" />
<appender-ref ref="RootConsoleAppender" />
</logger>
Instantsoup