如何停止log4net的故障排除 [英] How does one troubleshoot log4net when it stops logging
问题描述
似乎Log4Net默默关闭的原因不是很明显,我无所适从如何对其进行故障排除.我的直觉是,特定的附加程序在特定的日志消息上失败,并且似乎关闭了整个堆栈.
It seems that Log4Net silently shuts down for reasons that are not obvious, and I'm at a loss how to troubleshoot it. My hunch is that a particular appender is failing on a specific log message and that seems to shut down the whole stack.
是否有一种方法可以使Log4Net引发错误(至少在调试阶段),而不是过分地关闭服务.
Is there a way to get Log4Net to throw an exeception (at least during our debug phase) rather than a slient shutting down of the service.
推荐答案
我认为您可以在app.config/web.config的appSettings部分中放入一个配置值,以在log4net中打开内部调试语句:>
I think there's a config value you can put in the appSettings section of your app.config/web.config to turn on internal debug statements in log4net:
<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>
这将使您对log4net可能吞下的任何错误有一些了解.
This will give you some insight into any errors that log4net might be swallowing.
这篇关于如何停止log4net的故障排除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!