[
https://issues.apache.org/jira/browse/LOG4J2-2882?focusedWorklogId=454543&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-454543
]
ASF GitHub Bot logged work on LOG4J2-2882:
------------------------------------------
Author: ASF GitHub Bot
Created on: 04/Jul/20 17:04
Start Date: 04/Jul/20 17:04
Worklog Time Spent: 10m
Work Description: rgoers commented on pull request #381:
URL: https://github.com/apache/logging-log4j2/pull/381#issuecomment-653789389
Now that I look at this I find what was originally implemented rather odd.
The setLevel() and setParent() methods throw exceptions and yet the setFilter
method is still allowed. It seems to me if setFilter is supported then setLevel
should be too (i.e. it would call setLevel on the underlying Log4j Logger). But
if setLevel isn't supported then I don't understand why setFilter would be. In
any case, I wouldn't have setLevel throw an exception. At most I would just
ignore the call.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 454543)
Time Spent: 20m (was: 10m)
> 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
> Reporter: Emmanuel Bourg
> Priority: Minor
> Time Spent: 20m
> 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)