title: Filtering out Hibernate logs in Log4j2 file
body: <p>I have a <em>log4j2.xml</em> file as follows. It's working, but it's picking up a lot of Hibernate and GWT log files. How can I exclude those packages, or how can I have my logfile only include logging from my package hierarchy?</p>
  
  
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Configuration status="INFO"&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;File name="FileAllLogs" fileName="logs/MyProj_all.txt" immediateFlush="true" append="true"&gt;
              &lt;PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
          &lt;/File&gt;
          &lt;File name="FileAllErrors" fileName="logs/MyProj_errors.txt" immediateFlush="true" append="true"&gt;
              &lt;PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/&gt;
          &lt;/File&gt;
      &lt;/Appenders&gt;
      &lt;Loggers&gt;
          &lt;Root level="debug"&gt;
              &lt;AppenderRef ref="Console" /&gt;
              &lt;AppenderRef ref="FileAllLogs"/&gt;
          &lt;/Root&gt;
          &lt;Root level="error"&gt;
              &lt;AppenderRef ref="FileAllErrors"/&gt;
          &lt;/Root&gt;
      &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>