Saturday, 15 August 2015

episerver - How to make log4net.Filter.StringMatchFilter work with acceptOnMatch set to false -



episerver - How to make log4net.Filter.StringMatchFilter work with acceptOnMatch set to false -

i've started using log4net , have issues filtering using strings.

i'm trying remove episerver specific logging in log4net log file not interested in it.

i have next log4net configuration appender:

<filter type="log4net.filter.levelrangefilter"> <levelmin value="debug" /> </filter> <filter type="log4net.filter.stringmatchfilter"> <stringtomatch value="episerver" /> <acceptonmatch value="false" /> </filter> <filter type="log4net.filter.denyallfilter" />

i have 1 root logger. config not stop episerver logging.

what doing wrong?

try changing stringmatchfilter loggermatchfilter

<filter type="log4net.filter.loggermatchfilter"> <loggertomatch value="episerver" /> <acceptonmatch value="false" /> </filter>

a stringmatchfilter filters on content of log message, loggermatch filters on logger's class name or partial namespace

log4net episerver

No comments:

Post a Comment