我有一个空 app.config文件,但是我仍然收到NHibernate调试日志
I have an empty app.config file, but I still get NHibernate debug logs
NHibernate: SELECT this_.LogID as LogID71_0_, this_.Level as Level71_0_, this_.Message as Message71_0_, this_.EventTime as EventTime71_0_, this_.Component as ...我尝试添加具有错误日志级别的log4net配置,但是没有用.如何停止这些日志消息?
I tried adding a log4net configuration with an ERROR log level, but no use. How can I stop these log messages?
令我困惑的是,如果我有一个空的app.config,为什么它们会首先出现.对我而言,我必须对其进行配置以使其不打印这些消息没有意义-默认应为关闭状态.难道是我的代码以某种方式将它们设置为打开状态?我应该找什么?
The thing I'm puzzled about is why do these appear in the first place if I have an empty app.config to being with. It doesn't make sense to me that I have to configure it not to print these messaages - the default should be off. Could it be my code is setting them on programatically somehow? What should I look for?
推荐答案配置Log4Net与NHibernate一起使用可能会有所帮助.
您需要同时拥有这两个记录器:
You need to have both these loggers:
<logger name="NHibernate"> <level value="ERROR" /> </logger> <logger name="NHibernate.SQL"> <level value="ERROR" /> </logger>更多推荐
禁用NHibernate日志记录
发布评论