为什么这个 Fluent NHibernate 配置仍然将所有级别记录到 log4net?
我有以下 Fluent Nhibernate 配置:
public ISessionSource CreateSessionSource()
{
var config = Fluently.Configure()
.Database(MsSqlCeConfiguration
.Standard
.ConnectionString(connectionString)
.DoNot.ShowSql()
.UseOuterJoin()
.UseReflectionOptimizer())
.Mappings(GetMappings)
.Diagnostics(x => x.Enable(false))
.ExposeConfiguration(ExposeConfiguration);
Factory.RegisterSingleton(config);
var source = new SessionSource(config);
return source;
}
我知道 .Diagnostics(x => x.Enable(false)) 会阻止日志记录,但我仍然将整个 DEBUG、INFO、ERROR、FATAL 级别记录到我的 log4net 附加程序中。
任何指示或帮助将不胜感激。
谢谢
I have the following Fluent Nhibernate configuration:
public ISessionSource CreateSessionSource()
{
var config = Fluently.Configure()
.Database(MsSqlCeConfiguration
.Standard
.ConnectionString(connectionString)
.DoNot.ShowSql()
.UseOuterJoin()
.UseReflectionOptimizer())
.Mappings(GetMappings)
.Diagnostics(x => x.Enable(false))
.ExposeConfiguration(ExposeConfiguration);
Factory.RegisterSingleton(config);
var source = new SessionSource(config);
return source;
}
I had understood that the .Diagnostics(x => x.Enable(false)) would prevent logging but I am still getting the entire DEBUG,INFO,ERROR,FATAL levels logged to my log4net appenders.
Any pointers or help would be appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我了解,Diagnostics 方法控制 Fluent NHibernate 的日志记录级别,而不是 NHibernate 的日志记录级别。 NHibernate 的 log4net 日志记录级别应在您的配置文件中设置:
As I understand it, the Diagnostics method controls Fluent NHibernate's logging level, not NHibernate's. The log4net logging level for NHibernate should be set in your config file: