Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable JUL in 3rd party jar?

In 3rd party jar logger exist this code. 'Logger.getLogger("net.java.ao").log(Level.INFO, sql.toString());'
How can I disable this logger from my program?

like image 351
EK. Avatar asked Oct 22 '25 03:10

EK.


1 Answers

You could try to raise the LogLevel for the given logger-name "net.java.ao". Therefore, try to specify a custom Logger-configuration using the Java System-Property: "java.util.logging.config.file".

In the file you specified using the above system property, you can simply add the following line:

net.java.ao.level = OFF

Alternatively, you can also use the System-property: "java.util.logging.config.class", as described in the API docs: http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/api/java/util/logging/LogManager.html.

like image 52
Javaguru Avatar answered Oct 23 '25 16:10

Javaguru



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!