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

Property substitution not working if <Properties> tag is not placed at the beginning of configuration

    Details

    • Type: Documentation
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.11.1
    • Fix Version/s: 2.11.2
    • Component/s: Core
    • Labels:
    • Environment:

      Any project with log4j using as configuration a file like the one attached as example.

      With this configuration, logs will be printed as ${defaultLayout} instead of the actual message.

      Description

      Tweaking my log configuration I found out that if the <Properties> is not placed at the beginning of the config just after the <Configuration> tag, the property substitution is not performed at all.

      Looking at the documentation I haven't seen anything related to the ordering of the elements in the config files. If there's a good reason that the properties should be placed first place in configuration, it'd be a good idea to note it somewhere in the documentation.

        Attachments

        1. log4j2.xml
          0.4 kB
          Javier Armendáriz

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jarmendariz Javier Armendáriz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: