Intercepting Commons from Ant

I am trying to figure out how to make org.apache.commons.digester.Digester quieter. I collect JRXML files into jasper files (JasperReports reports) during build using Ant. I have logback.xml and slf4j and jcl-over-slf4j available in the classpath. I just can't understand the wiring.

The problem is that I have 200 reports and when they are compiled, Digester logs DEBUG messages, causing 55M log files and too much noise to find any actual errors. I just want to suppress DEBUG messages. Any help would be most appreciated.

Log fragment:

[jrc] 09:56:51.525 [main] DEBUG oacommons.digester.Digester.sax - setDocumentLocator( org.apache.xerces.parsers.AbstractSAXParser$LocatorProxy@543a586 d) [jrc] 09:56:51.525 [main] DEBUG oacommons.digester.Digester.sax - startDocument() [jrc] 09:56:51.998 [main] DEBUG oacommons.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 fragment:

 <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> 
+4
source share
1 answer

If you have a jcl-over-slf4j jar, a slf4j byte, and a log file in your class path, including the logback.xml file in the class path, you also need to enable commons logging to run through logback. Including something like 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> 
+3
source

Source: https://habr.com/ru/post/1314091/


All Articles