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


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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to