title: Is it possible to suppress only Warn messages in Log4j2 while allowing all others
body: <p>I am using log4j2 to log messages in console and in a file. I am getting a lot of Warn message which I do not want. I only want to see Debug and other messages. is it possible to suppress Warn messages while allowing Debug, Error and any other types of messages?</p>
  <p>I have looked at other answers here on stack overflow but they only tell about the suppression that suppresses all of the messages below that specific message level. For example, if I change my log level to Error I will automatically suppress Warn Debug and any other messages that are below this level. I do not want this behavior. I want to suppress Only Warn messages while allowing any messages below and above this level if it is possible. Below is my Log2j2 Config file.</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;Configuration status=&quot;error&quot;&gt;
      &lt;Appenders&gt;
          &lt;Console name=&quot;Console&quot; target=&quot;SYSTEM_OUT&quot;&gt;
              &lt;PatternLayout pattern=&quot;[%d{DEFAULT}][%5p][%t][%c{1}] - %m%n&quot; /&gt;
          &lt;/Console&gt;
          &lt;File name=&quot;MyFile&quot; fileName=&quot;logs/java.log&quot; immediateFlush=&quot;false&quot; append=&quot;true&quot;&gt;
              &lt;PatternLayout pattern=&quot;[%d{DEFAULT}][%5p][%t][%c{1}] - %m%n&quot;/&gt;
          &lt;/File&gt;
      &lt;/Appenders&gt;
      &lt;Loggers&gt;
          &lt;Root level=&quot;debug&quot;&gt;
              &lt;AppenderRef ref=&quot;Console&quot; /&gt;
              &lt;AppenderRef ref=&quot;MyFile&quot;/&gt;
          &lt;/Root&gt;
      &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>