在多线程应用程序中使用 java.util.logging 进行日志记录

发布于 2025-01-07 19:41:37 字数 237 浏览 2 评论 0原文

我有一个基于SAF(Swing应用程序框架)的swing应用程序。所有日志记录都是通过 java.util.logging 和两个不同的处理程序完成的:控制台和文件。 当我创建要由后台任务执行的操作时,这些任务不会记录不会显示在控制台或文件上,即使在调用 logger.log() 方法时没有错误/异常。

从不同线程使用 java.utils.logging 类有什么问题吗?我怎样才能更好地检查/解决这个问题?

谢谢, 朱塞佩

I have a swing application based on SAF (Swing Application Framework). All logging is done via java.util.logging and two different handlers: console and file.
When I create Action to be executed by background taks, these task do not logging does not show up on console or file, even if here is no error/exception when calling the logger.log() method.

Is there any problem in using java.utils.logging classes from different threads? How may I better check/resolv this problem?

Thanks,
Giuseppe

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别低头,皇冠会掉 2025-01-14 19:41:37

java.util.logging 在多线程应用程序中安全地工作。

您应该创建一个 SSCCE 来演示该问题。

java.util.logging works safely in a multi-threaded application.

You should create a SSCCE to demonstrate the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文