title: Log4j2 environment lookup does not find variable in AWS Linux EC2 instance
body: <p>I have a Tomcat WAR project running in AWS Elastic Beanstalk EC2 instances. I have configured the instances to ensure that they have an environment variable <code>CLUSTER_NAME</code>. I can verify that the variable is available in the EC2 instance.</p>
  <pre><code>[ec2-user@ip-10* ~]$ cat /etc/environment
  export CLUSTER_NAME=sandbox
  ec2-user@ip-10* ~]$ echo $CLUSTER_NAME
  sandbox
  </code></pre>
  <p>This variable is looked up in a Log4j2 XML file like this:</p>
  <pre><code>&lt;properties&gt;
      &lt;property name=&quot;env-name&quot;&gt;${env:CLUSTER_NAME}&lt;/property&gt;
  &lt;/properties&gt;
  </code></pre>
  <p>The <code>env-name</code> property is used in a Coralogix appender like this:</p>
  <pre><code>&lt;Coralogix name=&quot;Coralogix&quot; companyId=&quot;--&quot; privateKey=&quot;--&quot;
                     applicationName=&quot;--&quot; subSystemName=&quot;${env-name}&quot;&gt;
       &lt;PatternLayout&gt;
            &lt;pattern&gt;%d{yyyy-MM-dd HH:mm:ss.SSS}{GMT+0}\t%p\t%c\t%m%n&lt;/pattern&gt;
       &lt;/PatternLayout&gt;
   &lt;/Coralogix&gt;
  </code></pre>
  <p>I see that this lookup is not working, as the <code>env-name</code> is just shown as <code>${env:CLUSTER_NAME}</code> in Coralogix dashboard. The value works if I hardcode it.</p>
  <p>What can be done to fix this lookup? There are several related questions for this, but they seem to refer to log4j1.x. <a href="https://stackoverflow.com/a/22296362">https://stackoverflow.com/a/22296362</a>. I have ensured that this project uses log4j2.</p>