You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by "Victor Song (JIRA)" <ji...@apache.org> on 2012/07/10 22:38:35 UTC

[jira] [Commented] (LOG4NET-182) LevelRangeFilter behavior doesn't match documentation; behavior and documentation are not as expected

    [ https://issues.apache.org/jira/browse/LOG4NET-182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13410863#comment-13410863 ] 

Victor Song commented on LOG4NET-182:
-------------------------------------

The documentation for log4j seems to be correct in this regard.
                
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira