Log4j 2
  1. Log4j 2
  2. LOG4J2-419

Support default value for missing key in look ups with fallbacking to looking in the properties map

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-rc2
    • Component/s: None
    • Labels:
      None

      Description

      It is more useful and flexible to allow default value in the variable expression itself.
      For example,

      ${var1:-defvalue1},
      ${ctx:request_id:-defvalue2}, etc.
      

      This generic feature has been included in StrSubstitutor of commons-lang3 as well with the following issue:

      The benefit from the feature with LANG-893 is we can use it more widely whenever used in look ups.

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Unassigned
              Reporter:
              Woonsan Ko
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development