Log4j 2
  1. Log4j 2
  2. LOG4J2-94

Variable substitution: ${sys:foo} defaults to <property name=":foo">, should default to <property name="foo">

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta1
    • Fix Version/s: 2.0-beta3
    • Component/s: Core
    • Labels:
      None

      Description

      The following configuration doesn't work ($

      {sys:log.level}

      can't be resolved even though default value is provided).

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration status="OFF">
      <properties>
      <property name="log.level">error</property>
      <property name=":log.level">ACTUALLY_GETS_USED</property>
      </properties>
      <appenders>
      <Console name="Console" target="SYSTEM_OUT">
      <PatternLayout pattern="%d

      {HH:mm:ss.SSS}

      [%t] %-5level %logger

      {36}

      - %msg%n"/>
      </Console>
      </appenders>
      <loggers>
      <root level="$

      {sys:log.level}

      ">
      <appender-ref ref="Console"/>
      </root>
      </loggers>
      </configuration>

      In org.apache.logging.log4j.core.lookup.Interpolator.lookup(LogEvent, String), on line 110,
      var = var.substring(prefixPos) should be var = var.substring(prefixPos + 1) instead.

        Activity

        Ralph Goers made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Ralph Goers [ ralph.goers@dslextreme.com ]
        Fix Version/s 2.0-beta3 [ 12323368 ]
        Fix Version/s 2.0-beta2 [ 12323283 ]
        Resolution Fixed [ 1 ]
        Denis Treskunov created issue -

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Denis Treskunov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development