You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Emmanuel Bourg (Jira)" <ji...@apache.org> on 2020/07/02 11:35:00 UTC
[jira] [Commented] (LOG4J2-2882) JUL adapter ignores log filters
[ https://issues.apache.org/jira/browse/LOG4J2-2882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17150203#comment-17150203 ]
Emmanuel Bourg commented on LOG4J2-2882:
----------------------------------------
PR: https://github.com/apache/logging-log4j2/pull/381
> JUL adapter ignores log filters
> -------------------------------
>
> Key: LOG4J2-2882
> URL: https://issues.apache.org/jira/browse/LOG4J2-2882
> Project: Log4j 2
> Issue Type: Bug
> Components: JUL adapter
> Affects Versions: 2.13.3
> Environment: {{monospaced text}}
> Reporter: Emmanuel Bourg
> Priority: Minor
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Setting a {{java.util.logging.Filter}} on a logger has no effect when the JUL adapter is used. For example with:
> {code:java}
> Logger logger = new CoreLoggerAdapter().getLogger("test");
> logger.setFilter(record -> false);
> logger.info("Test");
> {code}
> the message is still logged.
> {{org.apache.logging.log4j.jul.ApiLogger}} does check the filter in its {{log(LogRecord)}} method, but the other log methods bypass it and call directly the underlying log4j logger.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)