如何在第 3 方 jar 中禁用 JUL?
在第 3 方 jar 记录器中存在此代码。 '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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试提高给定记录器名称“net.java.ao”的 LogLevel。
因此,尝试使用 Java 系统属性“java.util.logging.config.file”指定自定义记录器配置。
在使用上述系统属性指定的文件中,您只需添加以下行:
net.java.ao.level = OFF
或者,您也可以使用系统属性:“java.util.logging.config.class” ,如 API 文档中所述: http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/api/java/util/logging/LogManager.html。
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.