Log4Net。如何禁用内部调试

发布于 2024-09-27 01:54:30 字数 389 浏览 1 评论 0原文

我使用 log4net 和 AdoNetAppender 获得了一些测试控制台应用程序。

当我启动应用程序时,控制台中有 log4net 调试信息(log4net:错误 [AdoNetAppender] 无法打开数据库连接) 我通过代码初始化 AdoNetAppender ConnectionString。

当我设置 时它没有帮助。

我检查log4net.Util.LogLog.InternalDebugging; log4net.Util.LogLog.QuietMo​​de; 读取配置文件并配置 log4net 存储库后的属性。它们都是“假”。

为什么调试禁用不起作用?

I got some test console application with log4net and AdoNetAppender.

When I launch application I have log4net debug info in console(log4net:ERROR [AdoNetAppender] Could not open database connection)
I initialize AdoNetAppender ConnectionString via code.

When I set <log4net debug="false"> it doesn't help.

I check log4net.Util.LogLog.InternalDebugging;
log4net.Util.LogLog.QuietMode;
properties after I read config file and configure log4net repository. They are both 'False'.

Why debug disabling doesn't work ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

山有枢 2024-10-04 01:54:30

也许您已通过 app.config 中的应用程序设置启用了它:

<appSettings>
    <add key="log4net.Internal.Debug" value="true"/>
</appSettings>

这似乎覆盖了 log4net 节点上的设置。

Maybe you have it enabled with application settings in app.config:

<appSettings>
    <add key="log4net.Internal.Debug" value="true"/>
</appSettings>

This seems to ovverride the setting on the log4net node.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文