title: Why is my Log4j logging not displaying to the console?
body: <p>I have a web app built in Eclipse/STS with Spring MVC and Maven.</p>
  
  <p>I want to add logging, so I added SLF4 and Log4J to the pom.xml like this ..</p>
  
  <pre><code>     &lt;!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
          &lt;version&gt;1.7.30&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-simple&lt;/artifactId&gt;
          &lt;version&gt;1.7.30&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
       &lt;!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-log4j12 --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
          &lt;version&gt;1.7.30&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>I have a simple log4j.properties file in the <code>project/src/main/resources</code> folder, like this ...</p>
  
  <pre><code># Root logger option
  log4j.rootLogger=DEBUG, stdout, file
  
  # Redirect log messages to console
  log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.Target=System.out
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n
  </code></pre>
  
  <p>I created a Logger class in my main WebController, like this ...</p>
  
  <pre><code>private static Logger logger = LoggerFactory.getLogger(WebController.class);
  </code></pre>
  
  <p>And in my "showMain" method I'm doing some logging stuff, like this ...</p>
  
  <pre><code>@RequestMapping(value={"", "/", "showhome"}, method={RequestMethod.POST,RequestMethod.GET})
  public ModelAndView showHome(Model model) {
  
      logger.info("########### TEST LOG INFO");
      logger.error("########### TEST LOG ERROR");
      logger.warn("########### TEST LOG WARN");
      logger.debug("########### TEST LOG DEBUG");
  
      /* ... */
  }
  </code></pre>
  
  <p>But when I run the application, I don't see any logging output in the console.</p>
  
  <p>I also don't see anything in the console output to indicate that it is even using the logging framework.  And there's no "can't find log4j.properties" message or anything.</p>
  
  <p>I tried putting the log4j.properties in different places in the project, but nothing.</p>
  
  <p>I must be missing something simple?  What have I missed?</p>