title: Openshift : Spring boot : log4j settings -- configuration and finding the application log file
body: <p>My Spring boot application on Redhat/Openshift uses the shown log4j2.xml file. </p>
  
  <p><strong>The issue is that I cannot find the application log file.</strong> </p>
  
  <p>My questions are: </p>
  
  <ul>
  <li>Below I describe the way of configuring the log4j logging for Spring boot on Openshift. Is this correct?  </li>
  <li>Where can I find the application logging file logs/app2.log? It is not on Openshift. </li>
  <li>Yes, I know that there is also an app.log file via the application-openshift.properties setting. That one is never changed. Why? </li>
  </ul>
  
  <p>I was adviced to use this in de application-openshift.properties file. Leaving these lines out has no consequences. </p>
  
  <pre><code>logging.file = ${OPENSHIFT_DATA_DIR}/logs/app.log
  logging.level = INFO
  </code></pre>
  
  <p>My src/main/resources/log4j2.xml file contains the following. I configured it also for Console for local testing. Yes, later I could distinguish per environment (not for now). </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="WARN"&gt;
      &lt;Appenders&gt;
          &lt;Console name="Console" target="SYSTEM_OUT"&gt;
              &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" /&gt;
          &lt;/Console&gt;
          &lt;File name="File" fileName="logs/app2.log"&gt;
              &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" /&gt;
          &lt;/File&gt;
      &lt;/Appenders&gt;
      &lt;Loggers&gt;
          &lt;Root level="debug"&gt;
              &lt;AppenderRef ref="File" /&gt;
          &lt;/Root&gt;
          &lt;Logger name="nl.xyz.mod" level="debug" additivity="false"&gt;
              &lt;AppenderRef ref="File" /&gt;
          &lt;/Logger&gt;
          &lt;Root level="info"&gt;
              &lt;AppenderRef ref="Console" /&gt;
          &lt;/Root&gt;
          &lt;Logger name="nl.xyz.mod" level="info" additivity="false"&gt;
              &lt;AppenderRef ref="Console" /&gt;
          &lt;/Logger&gt;
      &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>