NHibernate 没有 log4net?
问题是 NHibernate 依赖于 log4net。我正在尝试构建一个带有可互换记录器的 IoC 应用程序,但这个东西妨碍了我。
是否有一个没有这种依赖性的构建,或者我是否必须自己进行一些开源代码黑客攻击?
The problem is NHibernates dependany on log4net. I am trying to build an IoC app with interchangable Loggers, and this thing gets in the way.
Is there a build out there without this dependancy or do I have to do some open source code hacking myself?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
关于此问题以及一个或多个补丁,NHibernate 错误跟踪器上已经存在一个未解决的错误已经存在,所以你可以使用那些。问题是它们还没有集成在主干上,所以 YMMV...
There is already an open bug on NHibernate bug tracker regarding this issue and one or more patches already exist so you could use that ones. The problem is that they are not integrated yet on trunk so YMMV...
是的,目前它是一种硬依赖。我认为您可以通过为 log4net 创建一个附加程序,然后将真正的记录器注入该附加程序来获得您想要的东西。因此,本质上您将使用 log4net 日志记录到您的日志记录 api,它将使用您注入的真实记录器。
您可能还想看看这个半相关的问题:
在 NHibernate 中使用 Enterprise Library 日志记录应用程序块
Yes it's currently a hard dependency. I think you can get what you want by creating an appender for log4net and then injecting your real logger into that appender. So essentially you'll have log4net log to your logging api which will use the real logger you inject.
You may also want to look at this semi-related question:
Using Enterprise Library Logging Application Block in NHibernate