title: Log4j logging not working
body: <p>I have added <code>log4j</code> from <a href="http://central.maven.org/maven2/log4j/log4j/1.2.17/log4j-1.2.17.jar" rel="nofollow">here</a> in build path. Wrote a simple method to test <code>log levels</code> but it doesn't print any thing console.</p>
  
  <pre><code>import org.apache.log4j.Level;
  import org.apache.log4j.Logger;
  
  public class LoggerLevelTest {
  
      private static org.apache.log4j.Logger log = Logger
              .getLogger(LoggerLevelTest.class);
  
      public static void main(String[] args) {
          log.setLevel(Level.WARN);
  
          log.trace("Trace Message!");
          log.debug("Debug Message!");
          log.info("Info Message!");
          log.warn("Warn Message!");
          log.error("Error Message!");
          log.fatal("Fatal Message!");
      }
  
  }
  </code></pre>
  
  <p><strong>Log4j.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="WARN"&gt;
      &lt;Properties&gt;
          &lt;Property name="LEVEL"&gt;WARN&lt;/Property&gt; &lt;!-- default value --&gt;
      &lt;/Properties&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="${sys:LEVEL}"&gt;
              &lt;AppenderRef ref="Console" /&gt;
          &lt;/Root&gt;
      &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>Actual output:</p>
  
  <pre><code>log4j:WARN Continuable parsing error 2 and column 30
  log4j:WARN Document root element "Configuration", must match DOCTYPE root "null".
  log4j:WARN Continuable parsing error 2 and column 30
  log4j:WARN Document is invalid: no grammar found.
  log4j:ERROR DOM element is - not a &lt;log4j:configuration&gt; element.
  log4j:WARN No appenders could be found for logger (LoggerLevelTest).
  log4j:WARN Please initialize the log4j system properly.
  log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
  </code></pre>
  
  <p>Expected Output: </p>
  
  <pre><code>Warn Message!
  Error Message!
  Fatal Message!
  </code></pre>
  
  <p>Above Example link: <a href="http://www.tutorialspoint.com/log4j/log4j_logging_levels.htm" rel="nofollow">http://www.tutorialspoint.com/log4j/log4j_logging_levels.htm</a></p>