我有一个应用程序,有时我想以登录Debug
模式登录。不幸的是,我与无法重建的第三方库链接。它是专为使用log4net
而设计的,并且在Debug
模式上非常冗长。
我不想从该库中收到任何通知。但是,我确实想从所有其他想要编写的代码中获取日志通知。
使用SMTPAppender
或RollingFile Appender
编写器时,是否有办法从记录中排除名称空间或库?
您可以使用过滤器,例如
<filter type="log4net.Filter.LoggerMatchFilter">
<!-- allows this sub-namespace to be logged... -->
<loggerToMatch value="Noisy.Namespace.But.Important" />
</filter>
<filter type="log4net.Filter.LoggerMatchFilter">
<!-- ...but not the rest of it -->
<loggerToMatch value="Noisy.Namespace" />
<acceptOnMatch value="false" />
</filter>
本文提供了更多详细信息。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句