禁用NHibernate日志记录

编程入门 行业动态 更新时间:2024-10-24 22:18:41
本文介绍了禁用NHibernate日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个空 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日志记录

本文发布于:2023-11-24 04:18:23,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1623940.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:日志   NHibernate

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!