简体   繁体   English

有多少项目在 log4j2 中使用 Async Logger?

[英]How many projects use Async Logger in log4j2?

Async loggers in log4j2 can improve the logging performance a lot, but are they robust enough? log4j2异步记录器可以log4j2提高日志记录性能,但它们是否足够健壮? When programs are killed unexpectedly, will the logging messages before that time point be flushed into disk?当程序被意外杀死时,该时间点之前的日志消息是否会刷新到磁盘中? And does anyone know how many big projects(such as apache projects) use async loggers and give some examples?有谁知道有多少大项目(例如apache项目)使用异步记录器并举一些例子? Any help will be appreciated.任何帮助将不胜感激。

When any process dies you are liable to lose log events that are being buffered.当任何进程终止时,您很可能会丢失正在缓冲的日志事件。 Most people who use File Appenders turn buffering on because the performance without it is considerably slower.大多数使用 File Appenders 的人都会打开缓冲,因为没有它的性能会相当慢。 Events in the OS buffer would be lost in that case.在这种情况下,操作系统缓冲区中的事件将丢失。 Likewise with most network protocols, unless you are using something like Apache Flume that immediately acknowledges the receipt, but even then a few messages could be lost simply because the process died before the data was written.与大多数网络协议类似,除非您使用 Apache Flume 之类的东西可以立即确认收到,但即使如此,也可能会因为进程在写入数据之前终止而丢失一些消息。 But Remko's answer covers the subject of losing messages better than I could.但是Remko 的回答比我能更好地涵盖丢失消息的主题。

As for who uses it I can only answer that we know that Async Loggers are being used since we do get questions from time to time but there is no way to formally track who is using any open source project, much less how.至于谁使用它,我只能回答说我们知道 Async Loggers 正在被使用,因为我们不时会收到问题,但是没有办法正式跟踪谁在使用任何开源项目,更不用说如何使用了。

我的公司将异步记录器用于任务关键型股票交易系统,没有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM