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

Routing appender does not expand nested variables

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.17.1
    • 2.17.2
    • Appenders
    • None

    Description

      Routing appender does not expand anymore nested variables.

      Using the configuration below, Log4J version 2.14.0 create correctly the file C:\tmp\test.log, but from Log4J version 2.17.0 the property expansion doesn't work anymore and a wrong file ${drive}${path}${name} is written in the current working directory.

       

       

      <Properties>
          <Property name="pcode">def</Property>
          <Property name="drive">C:</Property>
          <Property name="path">/tmp/</Property>
          <Property name="name">test.log</Property>
          <Property name="filename">${drive}${path}${name}</Property>
          <Property name="filepattern">${filename}.%i.backup</Property>
      </Properties>
      <Appenders>
          <Routing name="Routing">
              <Routes pattern="$${map:pcode}">
                  <Route>
                      <RollingFile name="Rolling" fileName="${filename}" filePattern="${filepattern}">
                          <PatternLayout>
                              <pattern>%map{data}%n</pattern>
                          </PatternLayout>
                          <SizeBasedTriggeringPolicy size="500" />
                      </RollingFile>
                  </Route>
              </Routes>
          </Routing>
      </Appenders>
      

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stemaio Stefano Maioli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: