gpt4 book ai didi

logging - 链锯 log4j 查看器的远程事件有什么意义?

转载 作者:行者123 更新时间:2023-12-04 17:29:13 24 4
gpt4 key购买 nike

http://logging.apache.org/chainsaw/quicktour.html
第一个特点。
我完成了教程,它只是展示了如何直观地使用 GUI,它根本没有详细介绍这个新功能。我找到的最好的文档是这样的:

Just as Appenders send logging events outside of the log4j environment (to files, to smtp, to sockets, etc), Receivers bring logging events inside the log4j environment.

Receivers are meant to support the receiving of remote logging events from another process. For example, SocketAppender "appends" a logging event to a socket, configured for a specific host and port number. On the receiving side of the socket can be a SocketReceiver object. The SocketReceiver object receives the logging event, and then "posts" it to the log4j environment (LoggerRepository) on the receiving machine, to be handled by the configured appenders, etc. The various settings in this environment (Logger levels, Appender filters & thresholds) are applied to the received logging event.

Receivers can also be used to "import" log messages from other logging packages into the log4j environment.

Receivers can be configured to post events to a given LoggerRepository.


所以...
我可以使用这个新组件实现什么样的日志记录策略,而我无法仅通过使用电锯 + 简单的 log4j 文件附加程序来使用它?

最佳答案

你可以用远程事件做很多有趣的事情:
- 避免在应用服务器上创建文件。文件坏了。
- 在多个应用服务器的情况下集中日志。
- 从本地环境查看实时生产日志,即使链锯不是很性感,过滤功能也比普通的 vi/grep 更方便。
- 登录数据库而不是文件。文件坏了。

而且可能更多!

关于logging - 链锯 log4j 查看器的远程事件有什么意义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/744775/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com