[ https://issues.apache.org/jira/browse/LOG4J2-3569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17578194#comment-17578194 ]
Ralph Goers commented on LOG4J2-3569: ------------------------------------- Welcome to the wonderful world of open source! I think the comment is just wrong. It should read "Return true if the logEvent should be excluded". I don't see any inconsistency in how AppenderControl or SmtpAppender are working. SmtpAppender is a bit strange in that excluded events are written to a buffer so that when an event that is NOT filtered is received all the events in the buffer are included as well. > Incorrect logic/code or comment for AbstractFilterable.isFiltered method > ------------------------------------------------------------------------- > > Key: LOG4J2-3569 > URL: https://issues.apache.org/jira/browse/LOG4J2-3569 > Project: Log4j 2 > Issue Type: Bug > Components: Filters > Affects Versions: 2.17.2 > Environment: All Enviroments > Reporter: Pawandeep Singh Bhatti > Priority: Blocker > > Hello, > > This is my first issue ever for an open source project. > > I was going through Log4j2 source code and stumbled upon following method: > {code:java} > /** > * Determine if the LogEvent should be processed or ignored. > * @param event The LogEvent. > * @return true if the LogEvent should be processed. > */ > @Override > public boolean isFiltered(final LogEvent event) { > return filter != null && filter.filter(event) == Filter.Result.DENY; > } {code} > > > Here is a link to the code on github: > [Link|https://github.com/apache/logging-log4j2/blob/40214e87c46c9534abcd8c5abf2b154f4c561002/log4j-core/src/main/java/org/apache/logging/log4j/core/filter/AbstractFilterable.java#L153] > Either the java doc is incorrect - which says @return true if the LogEvent > should be processed. > Or this line is wrong, > return filter != null && filter.filter(event) == Filter.Result.DENY; > > Please check. -- This message was sent by Atlassian Jira (v8.20.10#820010)