如何在 Log4Net 中设置每个附加程序的记录器特定级别
给定两个附加程序:A1、A2 和多个记录器,其中一个是 L1
是否可以配置 log4net,以便:
A1 从所有记录器获取 DEBUG 及以上信息,例外 L1,它获取 INFO 及以上信息< br> A2 从所有记录器中获取 DEBUG 及以上,
我查看了附加器阈值、过滤器和我能想到的所有其他配置组合,但它们似乎都没有实现上述目标。
Given two appenders: A1, A2 and multiple loggers one of which is L1
Is it possible to configure log4net such that:
A1 gets DEBUG and above from all loggers except L1, for which it gets INFO and above
A2 gets DEBUG and above from all loggers
I have looked at appender threshold, filters, and every other configuration combination I can think of but none of them seem to accomplish the above.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以执行以下操作:
我没有测试它,但我不明白为什么这不起作用。
You could do the following:
I did not test it, but I do not see why this would not work.
根据文档:
所以看起来像这样的东西会起作用(未经测试的伪代码):
According to the docs:
So it seems that something like this would work (untested pseudo-code):