Log4Net FileAppender 不是线程安全的?

发布于 2024-08-03 01:22:27 字数 116 浏览 1 评论 0原文

我需要登录到文件,因为客户没有可以使用 log4net 登录的控制台。 现在我读到 FileAppender 不是线程安全的。无论如何,有没有一种方法可以在退出不同线程的应用程序中登录到文件,或者什么是常见的替代方案?

I need to log to a file because the customer doesn't have a console of something where I can log to with log4net.
Now I read that the FileAppender is not thread safe. Is there anyhow a way to log to file within an app that logs out of different threads or what would be a common alternative?

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

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

发布评论

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

评论(1

那片花海 2024-08-10 01:22:27

Log4Net 本身 是线程安全的,即使 FileAppender 不是 - 框架会为您管理一切。只要您以正常方式登录(而不是直接写入附加程序),就应该没问题。

Log4Net itself is thread-safe even if FileAppender isn't - the framework manages everything for you. So long as you log in the normal way (rather than directly writing to the appender) you should be fine.

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