[
https://issues.apache.org/jira/browse/LOG4NET-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13875986#comment-13875986
]
Mark Evaul commented on LOG4NET-182:
------------------------------------
The behavior is correct. AcceptOnMatch = true should accept. AcceptOnMatch =
false should neutral. No match to the filter should deny. This is stated in
the documentation for LevelRangeFilter.AcceptOnMatch
(http://logging.apache.org/log4net/release/sdk/log4net.Filter.LevelRangeFilter.AcceptOnMatch.html)
The summary in the LevelRangeFitler documentation is in error and conflicting
with the property specific documentation
(http://logging.apache.org/log4net/release/sdk/log4net.Filter.LevelRangeFilter.html)
> LevelRangeFilter behavior doesn't match documentation; behavior and
> documentation are not as expected
> -----------------------------------------------------------------------------------------------------
>
> Key: LOG4NET-182
> URL: https://issues.apache.org/jira/browse/LOG4NET-182
> Project: Log4net
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 1.2.10
> Reporter: Chris Jerdonek
> Priority: Minor
> Fix For: 1.2 Maintenance Release
>
>
> The LevelRangeFilter's behavior doesn't match what the documentation says.
> Also, neither the current behavior nor the documentation seem right.
> The log4net SDK Reference documentation says this about
> log4net.Filter.LevelRangeFilter:
> "If there is a match between the range of priorities and the Level of the
> LoggingEvent, then the Decide method returns Accept in case the AcceptOnMatch
> option value is set to true, if it is false then Deny is returned. If there
> is no match, Deny is returned."
> The actual behavior seems to differ from this in the case of a match. If
> there is a match, it looks like the code returns Accept when AcceptOnMatch is
> true, and Neutral if AcceptOnMatch is false.
> I think both the documentation and behavior should be changed to the
> following:
> "If there is a match between the range of priorities and the Level of the
> LoggingEvent, then the Decide method returns Accept if the AcceptOnMatch
> option is true, and Deny if the AcceptOnMatch option is false. If there is
> no match, Neutral is returned."
> This behavior seems more natural. It also parallels the behavior of the
> LevelMatchFilter.
> I believe this can be fixed simply by swapping occurrences of
> FilterDecision.Deny and FilterDecision.Neutral in the code for
> LevelRangeFilter.Decide -- and also adjusting the documentation as above.
> Thanks.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)