You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2003/11/18 23:56:24 UTC

DO NOT REPLY [Bug 24803] New: - LevelMatchFilter not working as expected

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24803>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24803

LevelMatchFilter not working as expected

           Summary: LevelMatchFilter not working as expected
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Other
        AssignedTo: log4j-dev@jakarta.apache.org
        ReportedBy: egravel_fl@hotmail.com


LevelMatchFilter works as documented but not as expected.  The logic used by 
the decide(LogginEvent) method differs from what is expected by user and from 
looking at the logic employed by the filter LevelRangeFilter.

LevelRangeFilter's logic, and what I would expect LevelMatchFilter to use, is 
to return a Filter.DENY when the levels don't match,  Filter.ACCEPT if they 
match and property acceptOnMatch is true and Filter.NEUTRAL if acceptOnMatch 
is false to allow other filters to process a "valid" level event for this 
appender.

Right now, I'm using an appender for which I would like to only process events 
that are of level INFO.  So I assume a LevelMatchFilter would do the job since 
it attempt to do an exact match of levels.  Unfortunately, the appender is 
recording ALL levels.  

The only way you can get it working as expected is to do what is stated in the 
comment for bug #6773 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6773 
which is to add a second filter DenyAllFilter.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-dev-help@jakarta.apache.org