NServiceBus 通用主机和 Common.Logging
各位,
我按照此处的说明使 NServiceBus 日志记录正常工作: 但是
,我正在使用 Common .记录。如果我使用 LogManager 进行 Common.Logging,它不会记录日志。
如果我使用 log4net 的 LogManager,一切都会正常。
这里有人有任何见解吗?
Folks,
I got NServiceBus logging working correctly following the directions found here:
http://docs.particular.net/nservicebus/logging/
However, I am using Common.Logging. If I use the LogManager for Common.Logging, it doesn't log.
If I use the LogManager for log4net, everything works just fine.
Anyone have any insight here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我明白了这一点。我需要以编程方式设置 Common.Logging,而不是以声明方式(在配置文件中)。
基本上,我在进行流畅的总线配置之前添加了这一行:
我的总线日志记录部分如下所示:
这允许我在配置文件中加载日志记录级别,但按照 Udi 的建议将附加程序配置保留在代码中(并且我 我认为这是一个好主意)
我知道我可以使用 nServiceBus 的内置日志记录级别,但我不知道如何对其进行细粒度控制,以便我可以忽略 nHibernate 日志记录,但获取所有 nServiceBus 日志记录。
如果有人需要有关我所做的更多指导,请在此处发表评论,或者如果您知道如何使用 nServiceBus 日志记录级别获得细粒度控制,也请告诉我。
I figured this out. I needed to programatically set up Common.Logging instead of declaratively (in the config file).
Basically, I added this line before I did my fluent bus configuration:
And my bus logging section looks like this:
This allows me to load the logging levels in the config file, but leave the appender configuration in code as suggested by Udi (and I think it's a great idea)
I know I could of used the built in logging level of nServiceBus, but I couldn't figure out how to get fine grained control of that so that I could ignore nHibernate logging, but get all of the nServiceBus logging.
If anyone needs more guidance as to what I did, just comment here, or if you know how to get fine grained control using the nServiceBus logging level, let me know that too.
Common.Logging 作为 log4net 的抽象,用于 NServiceBus 的内部目的。
Common.Logging serves as an abstraction from log4net for the internal purposes of NServiceBus.
从 NServiceBus 5 开始,支持 OOTB CommonLogging http://docs.pspecial.net/nservicebus/logging /通用日志记录
As of NServiceBus 5 CommonLogging is supported OOTB http://docs.particular.net/nservicebus/logging/common-logging