[
https://issues.apache.org/jira/browse/LOG4J2-3096?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Mauricio lopez updated LOG4J2-3096:
-----------------------------------
Description:
Better described in [https://stackoverflow.com/q/67712907/9721979.]
But in summary, I'm unable to make log4j2 actually call the filters when they
are on a context-wide level, contrary to the default/included ones.
Basically, set up a threshold custom filter, as the example one (which has the
same behavior as the default one). When we put the custom one in the
context-wide location, in <configuration> tag in log4j2, I see via debugger
that the "filter" function isn't even called, but it is being called if using
the one included in log4j2.
So if the logger level is set to "info" and the thresholdFilter is set to
debug, I'm able to see a logger.debug("message") message, but if i do the same
with thresholdCustomFilter, then that message isn't logged.
I attached a sample project with the dependencies and a setup, with a custom
filter that should bypass everything. We can check by commenting and
uncommenting the two filter lines in the log4j2.xml. The custom filter, which
should bypass everything, is not getting considered.
was:
Better described in [https://stackoverflow.com/q/67712907/9721979.]
But in summary, I'm unable to make log4j2 actually call the filters when they
are on a context-wide level, contrary to the default/included ones.
Basically, set up a threshold custom filter, as the example one (which has the
same behavior as the default one). When we put the custom one in the
context-wide location, in <configuration> tag in log4j2, I see via debugger
that the "filter" function isn't even called, but it is being called if using
the one included in log4j2.
So if the logger level is set to "info" and the thresholdFilter is set to
debug, I'm able to see a logger.debug("message") message, but if i do the same
with thresholdCustomFilter, then that message isn't logged.
> Custom filters don't work when used context-wide
> ------------------------------------------------
>
> Key: LOG4J2-3096
> URL: https://issues.apache.org/jira/browse/LOG4J2-3096
> Project: Log4j 2
> Issue Type: Bug
> Components: Filters
> Affects Versions: 2.14.1
> Reporter: Mauricio lopez
> Priority: Major
> Attachments: sampleFilterTest.zip
>
>
> Better described in [https://stackoverflow.com/q/67712907/9721979.]
> But in summary, I'm unable to make log4j2 actually call the filters when they
> are on a context-wide level, contrary to the default/included ones.
> Basically, set up a threshold custom filter, as the example one (which has
> the same behavior as the default one). When we put the custom one in the
> context-wide location, in <configuration> tag in log4j2, I see via debugger
> that the "filter" function isn't even called, but it is being called if using
> the one included in log4j2.
> So if the logger level is set to "info" and the thresholdFilter is set to
> debug, I'm able to see a logger.debug("message") message, but if i do the
> same with thresholdCustomFilter, then that message isn't logged.
> I attached a sample project with the dependencies and a setup, with a custom
> filter that should bypass everything. We can check by commenting and
> uncommenting the two filter lines in the log4j2.xml. The custom filter, which
> should bypass everything, is not getting considered.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)