LOG4J2: Multiple loggers, to multiple appenders, at different logging levels
<p>What I'm trying to do is pretty straight forward: </p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Configuration&gt;
  &lt;Appenders&gt;
    &lt;Console name="Console"&gt;
      &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
    &lt;/Console&gt;

    &lt;File name = "hibernateFile" fileName = "${artifactId}/logs/hibernate.log"&gt; 
        &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
    &lt;/File&gt;

     &lt;File name = "springFile" fileName = "${artifactId}/logs/spring.log"&gt; 
        &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
    &lt;/File&gt;

    &lt;File name = "rootFile" fileName = "${artifactId}/logs/root.log"&gt; 
        &lt;PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
    &lt;/File&gt;        

  &lt;/Appenders&gt;
  &lt;Loggers&gt;
    &lt;Root level="trace"&gt;
      &lt;AppenderRef ref="Console"/&gt;
      &lt;AppenderRef ref="rootFile"/&gt;
    &lt;/Root&gt;

    &lt;Logger name ="org.springframework" level = "debug"&gt; 
        &lt;AppenderRef ref = "Console" level = "info"/&gt;
        &lt;AppenderRef ref = "springFile" level = "debug"/&gt;
    &lt;/Logger&gt;

     &lt;Logger name ="org.hibernate" level = "debug"&gt; 
        &lt;AppenderRef ref = "Console" level ="info"/&gt;
        &lt;AppenderRef ref = "hibernateFile" level = "debug"/&gt;
    &lt;/Logger&gt;

  &lt;/Loggers&gt;
&lt;/Configuration&gt;
</code></pre>

<p>I want only important messages to be displayed on my Console appender, while I want detailed messages to be routed to the file appenders. </p>

<p>However, I don't want to filter the appender itself - as I may want to route some debugging or trace messages there (for example when I'm in development). </p>

<p>The <a href="https://logging.apache.org/log4j/2.0/faq.html#config_sep_appender_level" rel="nofollow">Apache FAQ</a> suggests that I can just filter by logging level on the <code>AppenderRef</code>, but I've tried this, as outlined in the above xml - and it still routes the DEBUG level messages to the console. </p>

<p>I've also tried adding a ThresholdFilter to the <code>AppenderRef</code>, but that doesn't filter it either. </p>

<pre><code> &lt;Logger name ="org.hibernate" level = "debug"&gt; 
    &lt;AppenderRef ref = "Console"&gt;
         &lt;ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/&gt;
    &lt;/AppenderRef&gt;
    &lt;AppenderRef ref = "hibernateFile" level = "debug"/&gt;
&lt;/Logger&gt;
</code></pre>