Castle 日志记录工具和 log4net.Config.XmlConfigurator

发布于 2024-10-06 09:55:22 字数 142 浏览 1 评论 0原文

Castle 日志记录工具是否支持 log4Net.Config.XmlConfigurator.ConfigureAndWatch() 那样的任何功能?我想使用 Windsor 日志记录工具,但我真的希望能够在运行时更改日志记录配置。谁能指出我如何实现这一目标的方向?

Does the Castle Logging Facility support anything in the way of what log4Net.Config.XmlConfigurator.ConfigureAndWatch() does? I'd like to use the Windsor logging facility but I'd really like to be able to change the logging config at runtime as well. Can anyone point me in the direction of how I'd accomplish this?

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

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

发布评论

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

评论(1

疏忽 2024-10-13 09:55:22

According to this file in the Castle source repository, the Castle log4net implementation does (or can) do a ConfigureAndWatch. I haven't used Castle, so I can't comment on exactly how to take advantage of this. My first guess is that it should "just work". If you are using Castle and you can configure its logging to use log4net, you might already be getting ConfigureAndWatch. It is possible that ConfigureAndWatch only works if you configure log4net in its own config file (as opposed to the app.config or web.config). It should not be too difficult to test (if you are already using Castle) to see if ConfigureAndWatch works as expected.

If you are not using Castle already, you might want to wait for someone more familiar with Castle and Castle logging to post an answer.

Here are another SO post about Castle logging that you might find helpful:

This one shows log4net configuration in the app.config/web.config (the accepted answer is from February 2010. I don't know if there is more recent information available or not):

Logging with Castle.Facilities.Logging and log4net

Good luck!

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