I am using a third-party library which has a log4j.xml configuration - what's the best way to turn off the logging?
I think all that is required is to set the threshold parameter to OFF
<log4j:configuration threshold="OFF">
<root>
<priority value ="off" />
<appender-ref ref="console" />
<appender-ref ref="rolling-file" />
</root>
</log4j:configuration>
Or directly from code:
Logger.getRootLogger().removeAllAppenders();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With