在多线程应用程序中使用 java.util.logging 进行日志记录
我有一个基于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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
java.util.logging 在多线程应用程序中安全地工作。
您应该创建一个 SSCCE 来演示该问题。
java.util.logging works safely in a multi-threaded application.
You should create a SSCCE to demonstrate the problem.