title: How do I set Priority for root logger in Spring MVC?
body: <p>I am completely new to log4j. I have seen that there are two tags and tags, which refer to various appenders.
  As suggested by one of the link i.e
   <a href="https://stackoverflow.com/questions/12861104/why-do-we-need-root-and-logger-in-log4j-xml">why do we need root and logger in log4j.xml</a>
  "The only exception is the root logger that logs messages for the all classes in the application." I am using that(root logger).</p>
  
  <p>In my case, I have to log all exceptions having level error to my external file.  So I have used</p>
  
  <pre><code>&lt;!-- Root Logger --&gt;
  &lt;root&gt;
      &lt;priority value="error" /&gt;
      &lt;appender-ref ref="console" /&gt;
      &lt;appender-ref ref="FILE" /&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>but in my log file I am still able to see the info logger messages.
  I have to log only error messages, so please suggest to me what the solution might be,
  so I can correct it if I am wrong.</p>