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

RollingFile fileName containing variables does not work on 2.17.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.17.0
    • None
    • Appenders
    • None
    • Java 17, Ubuntu 20.04.

    Description

      A configuration like the below has stopped working since 2.17.0. The variables that originate from <Properties> are not resolved to their actual values.

      <Property name="logs_dir">$${env:LOGS_DIRECTORY}</Property> 
      <RollingFile name="Rolling-${ctx:logFile}" fileName="${logs_dir}/${ctx:logFile}"

       

      Works fine on 2.16.0.

      Attachments

        1. log4j2.xml
          1 kB
          Michael Cramer
        2. log4j2-appender-routing.xml
          1.0 kB
          Michael Cramer

        Issue Links

          Activity

            People

              ckozak Carter Kozak
              kliakos Konstantinos Liakos
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: