You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2020/04/04 22:30:04 UTC

[jira] [Updated] (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:all-tabpanel ]

Ralph Goers updated LOG4NET-182:
--------------------------------

LOG4NET is now dormant.  

> 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/2.0 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
(v8.3.4#803005)