使用 log4net 进行高速日志记录
我对 log4net 中的高速日志记录感兴趣(每秒大约 10K 消息)。 为此,我考虑实现以下模块:
- 基于协议缓冲区的布局(IRawlayout) - 实现卓越的序列化性能
- 共享内存追加器和插件 - 减少日志记录应用程序和日志记录服务器之间的 IPC。
这是整合这些技术的方式吗?
我还考虑过在 log4net 中使用 ETW 但它们似乎太不同了优雅地融合在一起。
I am interested in very high speed logging within log4net(around 10K messages per second).
to that end i thought of implementing the following modules:
- protocol buffers based Layout (IRawlayout) - for superior serialization performance
- shared memory appender and Plugin - to reduce IPC between the logging application and the logging server.
is this the way to integrate those technologies?
i also considered using ETW within log4net but they seem to be too different to be elegantly intergrated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
前段时间我调查了 log4net 性能并创建了一个 博客文章
您可以找到几个 log4net 异步转发附加程序:
使用 RollingFileAppender 的异步 log4net 解决方案的性能结果:
以及我关于log4net性能的一些注释:
Some time ago I made investigation of log4net performance and created a blog post
You can find there several log4net async forwarding appenders:
Performance results of asynchronous log4net solutions with RollingFileAppender:
And my some notes about log4net performance:
我曾经查看过 google protobuffer 并得出结论,它对日志记录的帮助并不像乍看起来那么大。日志记录涉及大量文本,无论如何,这些文本到处都是相同的文本。因此,protobuffers 的可移植性并不是一个优势。至于速度我也不确定,你仍然必须通过线路将相同的文本传输到服务器,要么打包到 protobuffer 数据包中,要么用 xml 标记。当然,如果您要记录文本信息,这是相关的。对于二进制日志记录来说,这可能是一件很酷的事情。
I once looked at google protobuffer and came to a conclusion that it won't be as great help with logging as it seems at first. Logging involves lots of text, which is same text everywhere anyway. So, portability of protobuffers is not an advantage. As to the speed I'm also not sure, you still have to transmit the same text over the wire to the server either packed into a protobuffer packet or tagged by xml. This, of course, is relevant if you are logging textual information. In case of binary logging it would probably be a cool thing to do though.