Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1317

Add ability for lookups to use defaults for other values than null

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5
    • Fix Version/s: None
    • Component/s: Lookups
    • Labels:
      None

      Description

      Trying to create a configuration using the ${web:contextPath} lookup worked fine, until I tried to use that with an empty contextPath.

      It is the case when the app is deployed as the root of the
      virtual host, case when the contextPath is an empty string (not null).

      The Interpolator is only checking for null. Likewise, StrSubstitutor will only use the default value if the lookup returns null, not an empty string.

      Not sure if it should be configurable somehow, maybe allow some sort of expression to express which value should trigger the use of the default value or just the empty string.

      Maybe an empty string has an actual usage in some cases.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              shadow Andrei Ivanov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: