How to write only INFO logs in log file log4j?
<p>I want to write only <code>INFO</code> logs to the <code>logfile</code>, below is my <code>log4j</code> configuration</p>

<p><code>log4j.properties</code> file is :</p>

<pre><code>log4j.rootLogger = INFO, FILE,
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE.File=logs.out
log4j.appender.FILE.ImmediateFlush=true
log4j.appender.FILE.Threshold=INFO
log4j.appender.FILE.Append=true
log4j.appender.FILE.MaxFileSize=100KB
log4j.appender.FILE.MaxBackupIndex=2
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss} %5p - %m%n
</code></pre>

<p>Java file is:</p>

<pre><code>import org.apache.log4j.Logger;

public class Log4jDemo {

    private static Logger log=Logger.getLogger(Logger.class.getName());

    public static void main(String[] args) {
        log.info("info");
        log.error("error");
        log.fatal("fatal");
        log.warn("warn");
    }
}
</code></pre>

<p><code>logs.out</code> file is:</p>

<pre><code>12 Apr 2016 15:38:35  INFO - info
12 Apr 2016 15:38:35 ERROR - error
12 Apr 2016 15:38:35 FATAL - fatal
12 Apr 2016 15:38:35  WARN - warn
</code></pre>

<p>Here I am getting logs in <code>logs.out</code> file are <code>INFO, ERROR, FATAL, WARN</code> but I want to write only <code>INFO</code> logs to <code>logs.out</code> file?</p>

<p>Anyone please suggest, how to achieve this objective?</p>

<p>my question is unique, it's not about <strong>log4j logging hierarchy order</strong> <a href="https://stackoverflow.com/questions/7745885/log4j-logging-hierarchy-order">log4j logging hierarchy order</a></p>

<p>this shows the default configuration of <code>log4j</code> framework, but I want to implement the custom one, can you please help me out to resolve the issue.</p>