How to configure a child logger with a lower loglevel than the root level in Log4net

我只是一个虾纸丫 提交于 2019-12-11 16:55:37

问题


The app I'm working on uses a library that generates a lot of INFO level messages I don't want to log. But the rest of the app and libraries produce INFO level messages I need to log.

How can I setup log4net so that all INFO messages are logged except for one logger that need to log only at WARN or above ? All messages need to be logged in the same files.

Julien


回答1:


<root>
  <level value="INFO" />
  <appender-ref ref="someappender" />
</root>
<logger name="AnotherLogger">
  <level value="WARN" />
</logger>


来源:https://stackoverflow.com/questions/1524547/how-to-configure-a-child-logger-with-a-lower-loglevel-than-the-root-level-in-log

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!