Log4Net configuring log level

后端 未结 5 743
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 20:03

How do I make Log4net only log Info level logs? Is that even possible? Can you only set a threshold?

This is what I have, and it logs Info and above as I would expect.

5条回答
  •  半阙折子戏
    2021-01-30 20:23

    you can use log4net.Filter.LevelMatchFilter. other options can be found at log4net tutorial - filters

    in ur appender section add

    
        
        
    
    

    the accept on match default is true so u can leave it out but if u set it to false u can filter out log4net filters

提交回复
热议问题