title: Mule Log4j2 configuration
body: <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="WARN"&gt;
      &lt;Properties&gt;
          &lt;Property name="log-path"&gt;${MULE_HOME}/logs/sfdc&lt;/Property&gt;
      &lt;/Properties&gt;
      &lt;Appenders&gt;
          &lt;Console name="console-log" target="SYSTEM_OUT"&gt;
              &lt;PatternLayout
                  pattern="[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n" /&gt;
          &lt;/Console&gt;
          &lt;RollingFile name="info-log" fileName="${log-path}/sfdc-info.log"
              filePattern="${log-path}/sfdc-info-%d{yyyy-MM-dd}.log"&gt;
              &lt;PatternLayout&gt;
                  &lt;pattern&gt;[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
                  &lt;/pattern&gt;
              &lt;/PatternLayout&gt;
              &lt;Policies&gt;
                  &lt;TimeBasedTriggeringPolicy interval="1"
                      modulate="true" /&gt;
              &lt;/Policies&gt;
          &lt;/RollingFile&gt;
          &lt;RollingFile name="trace-log" fileName="${log-path}/sfdc-trace.log"
              filePattern="${log-path}/sfdc-trace-%d{yyyy-MM-dd}.log"&gt;
              &lt;PatternLayout&gt;
                  &lt;pattern&gt;[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
                  &lt;/pattern&gt;
              &lt;/PatternLayout&gt;
              &lt;Policies&gt;
                  &lt;TimeBasedTriggeringPolicy interval="1"
                      modulate="true" /&gt;
              &lt;/Policies&gt;
          &lt;/RollingFile&gt;
          &lt;RollingFile name="error-log" fileName="${log-path}/sfdc-error.log"
              filePattern="${log-path}/sfdc-error-%d{yyyy-MM-dd}.log"&gt;
              &lt;PatternLayout&gt;
                  &lt;pattern&gt;[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n
                  &lt;/pattern&gt;
              &lt;/PatternLayout&gt;
              &lt;Policies&gt;
                  &lt;TimeBasedTriggeringPolicy interval="1"
                      modulate="true" /&gt;
              &lt;/Policies&gt;
          &lt;/RollingFile&gt;
      &lt;/Appenders&gt;
      &lt;Loggers&gt;
          &lt;AsyncLogger name="org.apache" level="WARN"/&gt;
          &lt;AsyncLogger name="org.springframework.beans.factory" level="WARN"/&gt;
          &lt;AsyncLogger name="org.mule" level="INFO"/&gt;
          &lt;AsyncLogger name="com.mulesoft" level="INFO"/&gt;
          &lt;Logger name="com.test" level="info" additivity="false"&gt;
              &lt;appender-ref ref="info-log" level="info" /&gt;
              &lt;appender-ref ref="trace-log" level="debug" /&gt;
              &lt;appender-ref ref="error-log" level="error" /&gt;
              &lt;appender-ref ref="console-log" level="debug" /&gt;
          &lt;/Logger&gt;
          &lt;Root level="info" additivity="false"&gt;
              &lt;AppenderRef ref="info-log" /&gt;
          &lt;/Root&gt;
      &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>In mule-app.properties specified MULE_HOME=C:/sfproject/test</p>
  
  <p>Problem I am facing is it doesn't get the path ${MULE_HOME} location from mule-app.properties but it goes and creates a directory under home location of the project(MULE_HOME=C:/sfproject/) as ${MULE_HOME}/logs in my local directory. I want all log files should go under C:/sfproject/test/logs directory.</p>
  
  <p>when I deploy same in server( commented mule_home path in mule-app.properties since it is not required and it should point to server location then logs directory), no log files are created under servers/logs directory.</p>
  
  <blockquote>
    <p>EDIT:</p>
  </blockquote>
  
  <p>Based on Ryan answer given below, to work locally in anypoint studio, right click on project->Run as->run configuration->ENVIRONMENT->New->Name(MULE_HOME)->Value(c:/project/test)->ok->apply->run.</p>