Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable particluar level in log4net

I have to disable only trace level in my project using log4net. 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 log4net?

like image 720
Vetrivel mp Avatar asked Feb 20 '23 22:02

Vetrivel mp


1 Answers

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>
like image 194
Dmitry Reznik Avatar answered Mar 07 '23 08:03

Dmitry Reznik