title: Issues with Log Levels in Spring Boot application.properties
body: <p>I am using Log4J 2 in a Spring Boot application and trying to configure few basic logging options via application.properties. </p>
  
  <p>I have setup a logger in my controller class, like this.</p>
  
  <pre><code>package guru.springframework.controllers;
  - - - -
  @Controller
  public class IndexController {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());
    @RequestMapping("/")
    String index(){
      logger.debug("This is a debug message");
      logger.info("This is an info message");
      logger.warn("This is a warn message");
      logger.error("This is an error message");
      return "index";
     }
  }
  </code></pre>
  
  <p>In application.properties, I have the following properties.</p>
  
  <pre><code>logging.level.guru.springframework.controllers=DEBUG
  logging.level.org.springframework.web=INFO
  logging.file=logs/spring-boot-logging.log
  </code></pre>
  
  <p>Spring internal loggigng messages are getting logged with INFO level in the console when I start the app. This is expected from the <strong>logging.level.org.springframework.web</strong> property. However, when the controller gets invoked, only messages of <strong>info()</strong> and lower gets logged. With the <strong>logging.level.guru.springframework.controllers</strong> property set to DEBUG, why isn't the message of the <strong>debug()</strong> method getting logged. If I add the following to application.properties.</p>
  
  <pre><code>logging.level.root=ERROR
  </code></pre>
  
  <p>Now, no messages are sent to console on Spring startup (Obviously the Error level has been picked up this time). Similarly the controller emits only the <strong>error()</strong> method message. So, is there any specific priority of picking up levels from application.properties. </p>
  
  <p>Is there a way to set up different levels for a different package (Say, the controller package) independent of the level specified for <strong>logging.level.root</strong> and <strong>logging.level.org.springframework.web</strong> in application.properties. </p>
  
  <p>I don't want to use any other external configuration file.</p>