扩建温莎城堡的伐木设施
我目前正在使用 Castle Windsor 日志记录工具的 log4net 部分,如下所示:
objContainer.AddFacility("logging", New LoggingFacility(LoggerImplementation.Log4net)WithConfig("Configs\Log4net.config"))
我需要将几个变量传递给记录器,因为我使用的是动态日志文件名。我查看了源代码,并确定一种可能的做法是创建自定义工厂和设施,但这需要大量工作,而且我不确定这是最佳实践。
我注意到 Castle 有一个 ExtendedLog4Net 版本,但似乎很少有关于它的文档。谁能阐明实现这一目标的最佳方法?
谢谢,
罗斯。
I'm currently using the log4net portion of the Castle Windsor logging facility, like so:
objContainer.AddFacility("logging", New LoggingFacility(LoggerImplementation.Log4net)WithConfig("Configs\Log4net.config"))
I need to pass in a couple of variables to the logger because I am using dynamic log file names. I have looked at the source code and determined that one possible course of action is to create a custom factory and facility but this is alot of work and I'm not sure it is best practice.
I note Castle has an ExtendedLog4Net version but there seems to be little documentation on it. Can anyone shed any light on the best way to achieve this?
Thanks,
Ross.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终使用 CreateChildLogger() 方法来创建所需的记录器,因为我对该项目有时间限制。感谢您的所有建议。
I ended up using the CreateChildLogger() method to create the loggers needed as I had time constraints on this project. Thanks for all of the advice.