As there are following levels in log4net
Can anyone please tell me in log4net how can I log only INFO & ERROR or DEBUG & ERROR? What I mean here is be able to log two different levels which are not in sequence?
I can't do if I use following because warning messages will be logged as well which I don't want:
<filter type="log4net.Filter.LevelRangeFilter">
<acceptOnMatch value="true" />
<levelMin value="INFO" />
<levelMax value="ERROR" />
</filter>
Use LevelMatchFilter in conjunction with DenyAllFilter:
<filter type="log4net.Filter.LevelMatchFilter">
<acceptOnMatch value="true" />
<levelToMatch value="INFO" />
</filter>
<filter type="log4net.Filter.LevelMatchFilter">
<acceptOnMatch value="true" />
<levelToMatch value="ERROR" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With