Details
-
New Feature
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
None
-
Pulsar
-
Platform Sprint 154
Description
The JndiPropertyFilter and MdcOrJndiPropertyFilter classes commonly used in log4j.xml configurations for cms or site application context based log filtering (CMS-7226) no longer can be used with log4j2.
Therefore a new and more generic log4j2 LookupFilter is crafted to replace these log4j1 filters.
The new LookupFilter can be used generically to interpolate and filter on all log4j2 Lookup Variables.
Typical usage replacing MdcOrJndiPropertyFilter in log4j.xml:
<filter class="org.onehippo.cms7.logging.log4j.MdcOrJndiPropertyFilter"> <param name="name" value="logging/contextName" /> <param name="resourceRef" value="true" /> <param name="value" value="cms" /> <param name="onMatchOption" value="ACCEPT" />
to LookupFilter in log4j2.xml:
<LookupFilter key="jndi:logging/contextName" value="cms" onMatch="ACCEPT"/>
The MdcOrJndiPropertyFilter class will be dropped (the Mdc based filtering in practice never was used).
The JndiPropertyFilter class will only be deprecated, to keep supporting existing runtime usage of log4j1 not yet ready to upgrade to log4j2.