简体   繁体   中英

Disable particluar level in log4net

I have to disable only trace level in my project using log.net. I googled it but it didn't help me. So can anyone help me out how to turn off only trace level as well as all particular level turn off logging in log.net?

You can use LevelMatch filter with AcceptOnMatch = false. That way it would exclude selected level from logging.

<filter type="log4net.Filter.LevelMatchFilter">
    <AcceptOnMatch value="false" />
    <LevelToMatch value="TRACE" />
</filter>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM