title: Unable to access file:log4j.properties, but have told Maven to use only log4j2
body: <p>I'm getting this message:</p>
  
  <blockquote>
    <p>ERROR StatusLogger Unable to access file:log4j.properties
    java.io.FileNotFoundException: log4j.properties (No such file or
    directory)... (+ stacktrace)</p>
  </blockquote>
  
  <p>...despite telling Maven to get 2.1 AND I have log4j2.xml AND I do not have a log4j.properties. My log4j2.xml is working very well doing just what I want it to.</p>
  
  <p>I get this in the console whenever I run JUnit (4.x) tests.</p>
  
  <p>I am using IntelliJ to Run/Debug. I'm using JDK 1.8.0_25.</p>
  
  <p>It is true that this is the first time I've used log4j 2.x, but I do not understand why this stacktrace is showing up as if I had log4j 1.x JARs or were asking for log4j 1.x.</p>
  
  <pre><code>$ mvn dependency:tree
  [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ cda-feeder ---
  [INFO] com.imatsolutions:cda-feeder:jar:1.0.0-SNAPSHOT
  [INFO] +- sax:sax:jar:2.0.1:compile
  [INFO] +- org.apache.logging.log4j:log4j-api:jar:2.1:compile
  [INFO] +- org.apache.logging.log4j:log4j-core:jar:2.1:compile
  [INFO] \- junit:junit:jar:4.11:test
  [INFO]    \- org.hamcrest:hamcrest-core:jar:1.3:test
  </code></pre>
  
  <p>My <em>log4j2.xml</em>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration xmlns="http://logging.apache.org/log4j/2.0/config"&gt;
    &lt;Properties&gt;
      &lt;Property name="LEVEL"&gt;trace&lt;/Property&gt;
      &lt;Property name="log-path"&gt;/var/log/search/&lt;/Property&gt;
      &lt;Property name="logfile-size"&gt;1 GB&lt;/Property&gt;
      &lt;Property name="cda-filter"&gt;cda-filter&lt;/Property&gt;
      &lt;Property name="console-pattern"&gt;%d{ABSOLUTE} %5p %c{1}:%L - %m%n&lt;/Property&gt;
      &lt;Property name="file-pattern"&gt;   %d{ABSOLUTE} %5p %c{1}: %m%n    &lt;/Property&gt;
    &lt;/Properties&gt;
  
    &lt;Appenders&gt;
      &lt;Console name="console" target="SYSTEM_OUT"&gt;
        &lt;PatternLayout pattern="%-5p | %d{yyyy-MM-dd HH:mm:ss} | [%t] %C{2} (%F:%L) - %m%n" /&gt;
      &lt;/Console&gt;
  
      &lt;RollingFile name="rollingfile"
                   fileName="${log-path}/${cda-filter}.log"
                   filePattern="${log-path}/${cda-filter}-%d{yyyy-MM-dd}-%i.log"
                   append="true"&gt;
        &lt;PatternLayout pattern="${file-pattern}" /&gt;
        &lt;Policies&gt;
          &lt;SizeBasedTriggeringPolicy size="${logfile-size}" /&gt;
        &lt;/Policies&gt;
        &lt;DefaultRolloverStrategy max="4" /&gt;
      &lt;/RollingFile&gt;
    &lt;/Appenders&gt;
  
    &lt;Loggers&gt;
      &lt;Logger name="root" level="${LEVEL}" additivity="false"&gt;
        &lt;appender-ref ref="rollingfile" level="${LEVEL}" /&gt;
      &lt;/Logger&gt;
  
      &lt;Root level="${LEVEL}" additivity="false"&gt;
        &lt;AppenderRef ref="console" /&gt;
        &lt;AppenderRef ref="rollingfile" /&gt;
      &lt;/Root&gt;
    &lt;/Loggers&gt;
  
  &lt;/Configuration&gt;
  </code></pre>