tags:

views:

66

answers:

1

I have configured this filter for one of my log4net appenders (uses AdoNetAppender):

    <filter type="log4net.Filter.LevelRangeFilter">
      <levelMin value="DEBUG" />
      <acceptOnMatch value="true" />
    </filter>
    <filter type="log4net.Filter.PropertyFilter">
      <key value="c" />
      <stringToMatch value="Stribe.Kernel" />
      <acceptOnMatch value="true" />
    </filter>
    <filter type="log4net.Filter.DenyAllFilter" />

I'm probably doing something really wrong, but been trying to figure it out for an hours now and it's driving me crazy. What i want the filter to do is deny all entries, except those who's logger name begin (or contain, both fine for me) with "Stribe.Kernel"

Also tried something with but i cannot get it to work.

Any suggestions?

+2  A: 

How about you attach the appender to the logger "Stribe.Kernel" instead of the root logger like this:

<root>
    <level value="ALL" />
</root>
<logger name="Stribe.Kernel">
    <level value="DEBUG" />
    <appender-ref ref="YourAppender" />
</logger>

If you are using other loggers you can still attach them to the root logger.

Stefan Egli
Thanks! This solved it for me.
Ruud