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

log4j2 config variableResolver Prefix and Suffix should configable

    XMLWordPrintableJSON

    Details

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

      Description

      current variableResolverPrefix=${ and variableResolverSuffix=}
      There will be a issue if the variable default value has "}"
      ie :
      ```
      ${env:logStdoutPattern:-%d

      {yyyyMMddHH:mm:ss}

      %-5p %c

      {20}:%L - %m%n}
      ```
      if we change the variableResolverPrefix, that will solve the problem
      ```log4j2.proprties
      variableResolverPrefix=$(
      variableResolverSuffix=)
      appender.console.layout.pattern=$(env:logStdoutPattern:-%d{yyyyMMddHH:mm:ss} %-5p %c{20}

      :%L - %m%n)
      ```
      ref PR: https://github.com/apache/logging-log4j2/pull/312

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              qxo qxo
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: