logstash的NLOG配置
假设一个大约20个生产商生成应用程序诊断数据(日志)的系统,每个系统都使用以下NLOG logStash目标配置:
<!-- https://github.com/NLog/NLog/wiki/Network-target -->
<target xsi:type="Network" name="logstash"
address="tcp://logstash-server:port"
newLine="true"
maxMessageSize="65000" onOverflow="Discard"
connectionCacheSize="5" keepConnection="True" KeepAliveTimeSeconds="30" >
<layout xsi:type="JsonLayout" includeAllProperties="true">
...
</layout>
</target>
我有以下注意事项,您的意见将不胜感激:
- 将LogStash Target用
BufferingWrapper包装logstash目标是有意义的
?这会导致一条巨大消息,可能超过maxMessagesize
? - 还是出于某种原因使用
asyncwrapper
更好? - 鉴于每个有20个生产商保持5个连接,是否有任何可以击中的TCP限制?
我想首先从强耦合开始,然后才考虑将日志记录到日志文件中,然后将其运送到LogStash。还感谢任何有用的参考文献或较大项目的GitHub示例。
References:
https://github.com/nlog/nlog/wiki/BufferingWrapper-target< /a>
Assume a system of about 20 producers generating application diagnostic data (logs), each using the following NLog logstash target configuration:
<!-- https://github.com/NLog/NLog/wiki/Network-target -->
<target xsi:type="Network" name="logstash"
address="tcp://logstash-server:port"
newLine="true"
maxMessageSize="65000" onOverflow="Discard"
connectionCacheSize="5" keepConnection="True" KeepAliveTimeSeconds="30" >
<layout xsi:type="JsonLayout" includeAllProperties="true">
...
</layout>
</target>
I have the following considerations and your opinion would be appreciated:
- Would it make sense to wrap the logstash target with
BufferingWrapper
? Will this result in one giant message, possibly exceeding themaxMessageSize
? - Or is it better to use the
AsyncWrapper
for some reason? - Given that 20 producers each hold 5 connections, are there any TCP limits which can be hit?
I would like to start with strong coupling first and only later consider logging to log files which are then shipped to logstash. Any useful references or github examples for larger projects are also appreciated.
References:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据网络目标的工作原理,我认为不需要任何包装器。网络目标已经包含一个队列,该队列可以在完整时删除消息。因此,目前以下是一个合理的配置:
Based on the how the Network target works I think there is no need for any wrappers. The network target already contains a queue which can drop messages when full. So at the moment the following is a reasonable configuration to start with: