使用 NServiceBus Generic Host 添加额外的附加程序

发布于 2024-09-13 01:07:25 字数 165 浏览 3 评论 0原文

谁能在这里指出正确的方向。

是否可以为每个配置文件提供单独的 log4net 配置文件?

这样我就可以拥有 Production.log4net.config 和 lite.log4net.config 吗?

如果该配置位于通用主机中已内置的编程配置之上,那就更酷了。

Can anyone point me in the right direction here.

Is it possible to have separate log4net config files for each profile?

In that way I could have a production.log4net.config and a lite.log4net.config?

It would be even more cool if that configuration was on top of the programmatic configuration already build into the generic host.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

与之呼应 2024-09-20 01:07:25

您必须用自己的配置文件覆盖配置文件,然后实现 IConfigureLoggingForProfile 并在其中调用:

NServiceBus.SetLoggingLibrary.Log4Net(() => log4net.Config.XmlConfigurator.Configure(File.OpenRead("production.log4net.config “)));

You'd have to override the profiles with your own, and then implement IConfigureLoggingForProfile and in there call:

NServiceBus.SetLoggingLibrary.Log4Net(() => log4net.Config.XmlConfigurator.Configure(File.OpenRead("production.log4net.config")));

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文