You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Pawandeep Singh Bhatti (Jira)" <ji...@apache.org> on 2022/08/12 05:30:00 UTC
[jira] [Updated] (LOG4J2-3569) Incorrect logic/code or comment for AbstractFilterable.isFiltered method
[ https://issues.apache.org/jira/browse/LOG4J2-3569?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Pawandeep Singh Bhatti updated LOG4J2-3569:
-------------------------------------------
Priority: Minor (was: Blocker)
> 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: Minor
>
> 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)