开发者

Add additional appenders with NServiceBus Generic Host

开发者 https://www.devze.com 2023-01-09 20:43 出处:网络
Can anyone point me in the right direction here. Is it possible to have separate log4net config files for each profile?

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 produ开发者_运维百科ction.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.


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")));

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号