Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-10709

Provide generic log4j2 LookupFilter to replace the deprecated log4j1 JndiPropertyFilter

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 12.0.0, commons-4.0.0
    • 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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              adouma Ate Douma
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: