在log4net中,我希望通过NDC的值过滤日志消息,如下所示:
<filter type="log4net.Filter.PropertyFilter">
<Key value="NDC" />
<stringToMatch value="MyContext" />
</filter>不知怎么的,上面的过滤器并没有像我预期的那样工作。
如何为仅与特定NDC匹配的附加器配置筛选器?
发布于 2009-11-04 23:36:29
我刚刚找到了解决方案。我忘了添加下面这行代码来过滤掉不匹配的事件:
<filter type="log4net.Filter.DenyAllFilter" />https://stackoverflow.com/questions/1674411
复制相似问题