title: Getting log4j2 to work with eclipse
body: <p>I know there is allot of questions been asked on this but i have been trying to get this to work for few day's and i am not any more forward then when i started.</p>
  
  <p>i have tried to use <code>-Dlog4j.configuration=file:/path/to/log4j.properties</code> and <code>-Dlog4j.debug</code> in eclipse vm arguments (under debug &amp; run) and get no output</p>
  
  <p>I have tried to use .properties and .xml but no joy</p>
  
  <p>Tried to put the .xml and .properties files at the root, in the src and in an external folder which i added to my classpath ... still no joy</p>
  
  <p>I think its using another .xml or .properties files in another lib/jar but because i cant get any debug to work i am finding very difficult to track what i am doing wrong here...</p>
  
  <p>any help would be great! below is the code .. only the error message get's printed.</p>
  
  <p>I have download (<a href="http://logging.apache.org/log4j/2.x/download.html" rel="noreferrer">http://logging.apache.org/log4j/2.x/download.html</a>) and imported into my app the 
  <code>log4j-api-2.0-beta8.jar
  log4j-core-2.0-beta8</code></p>
  
  <pre><code>import org.apache.logging.log4j.LogManager;
  import org.apache.logging.log4j.Logger;
  
  public class CucmServMonitor 
  {
   private static final Logger logger  = LogManager.getLogger(CucmServMonitor.class.getName())
    public static void main(String[] args) 
    {
      logger.error("testing ERROR level");
      logger.trace("exiting application");
      System.out.println(logger.getName());   
    }
  }
  </code></pre>
  
  <p>the xml file i am using just now log4j2.xml</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;/appenders&gt;
   &lt;loggers&gt;
    &lt;root level="debug"&gt;
     &lt;appender-ref ref="Console"/&gt;
    &lt;/root&gt;
   &lt;/loggers&gt;
  &lt;/configuration&gt;
  </code></pre>