开发者

How to disable JUL in 3rd party jar?

开发者 https://www.devze.com 2023-01-07 04:59 出处:网络
In 3rd party jar logger exist this code. \'Logger.getLogger(\"net.java.ao\").log(Level.INFO, sql.toString());开发者_开发问答\'

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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消