Pregunta

I have slf4j and logback jars in the class path with the following logback.xml file (this file has been used successfully before) . However, docx4j 3.0 still prints logging information to the standard out. I am using Netbeans 7.4 to build the docx4j based application. I would like to change the logging level to error and send it to a log file. Not sure what I am missing. Any help is much appreciated.

<configuration>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>PMG-Seed.log</file>
<append>false</append>
<encoder>
<pattern>%date [%level] %thread [%logger{50}] %msg%n</pattern>
</encoder>
</appender>
<root level="debug">
<appender-ref ref="FILE" />
</root>
</configuration
¿Fue útil?

Solución

I figured the issue has nothing to do with docx4j. One library jar (CDK 1.4.19) file had a version of sjf4j bundled in. If you run into this situation add these lines and test your slf4j/logback configuration.

LoggerContext lc = (LoggerContext)LoggerFactory.getILoggerFactory();
StatusPrinter.print(lc);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top