Log4j DailyRollingFileAppender 多进程并发

发布于 2024-08-18 03:45:12 字数 262 浏览 1 评论 0原文

我有许多相同的进程正在使用 Log4j DailyRollingFileAppender 写入单个日志文件。我担心多个进程可能会尝试滚动文件,从而导致混乱。该实现是否允许使用某种锁定机制? - Javadoc 没有提到它。

I have a number of identical processes that are writing to a single log file using a Log4j DailyRollingFileAppender. I am concerned that multiple processes may try and roll the file and that chaos will ensue. Does the implementation allow for this using with some kind of locking mechanism? - the Javadoc doesn't mention it.

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

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

发布评论

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

评论(1

不离久伴 2024-08-25 03:45:12

不建议让多个进程访问同一个日志文件。将会发生混乱

it is not advisible to let multiple processes access the same log file. mayhem will occur

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