Page 1 of 1

How to configure log on docx4j 3.2.1

PostPosted: Sat Feb 28, 2015 3:33 am
by carlosegomez
Hello everybody,

I'm trying to turn off the log output (console) on docx4j version 3.2.1 and I cannot do it. I realized the log manager changed from log4j to slf4j, therefore I guess the property docx4j.Log4j.Configurator.disabled does not work.

Thus, how can I turn off the log in this new version?

Thanks for your help

Re: How to configure log on docx4j 3.2.1

PostPosted: Sat Feb 28, 2015 9:48 am
by jason
That's right, the property docx4j.Log4j.Configurator.disabled was only there to prevent automatic config of log4j.

Now that that's gone, its just a matter of configuring slf4j to your liking; see generally http://www.slf4j.org/

To totally turn off logging, see http://stackoverflow.com/a/8748518/1031689 in answer to http://stackoverflow.com/questions/2372 ... from-slf4j
(and make sure the only other slf4j related jar file on your classpath is slf4j-api)

If you want to selectively configure logging, well, the easiest way is to include slf4j-log4j12 and https://github.com/plutext/docx4j/blob/ ... /log4j.xml

Re: How to configure log on docx4j 3.2.1

PostPosted: Mon Mar 02, 2015 7:30 pm
by carlosegomez
Thanks Jason!!!

Re: How to configure log on docx4j 3.2.1

PostPosted: Mon Mar 02, 2015 8:07 pm
by carlosegomez
In fact, I remove slf4j-simple-1.7.5.jar and add slf4j-nop-1.7.5.jar.