log4j2 prints new line between stdout
<p>Why does log4j prints a new line break in stdout appender?</p>

<p>my log4j2.xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Configuration xmlns="http://logging.apache.org/log4j/2.0/config"&gt;
    &lt;Appenders&gt;
        &lt;File name="FILE" fileName="&lt;&lt;FILEPATH&gt;&gt;\logfile.log"
            append="true"&gt;
            &lt;PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} | %-5p | %l - %m%n" /&gt;
        &lt;/File&gt;
        &lt;File name="UIFILE" fileName="&lt;&lt;FILEPATH&gt;&gt;\uilogfile.log"
            append="true"&gt;
            &lt;PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} | %m%n" /&gt;
        &lt;/File&gt;
        &lt;Console name="STDOUT" target="SYSTEM_OUT"&gt;
            &lt;PatternLayout&gt;
                &lt;pattern&gt;[%-5p] %C{2} - %m%n&lt;/pattern&gt;
            &lt;/PatternLayout&gt;
        &lt;/Console&gt;
    &lt;/Appenders&gt;
    &lt;Loggers&gt;
        &lt;Logger name="org.apache.log4j.xml" level="INFO"/&gt;
        &lt;Logger name="com.foo" level="DEBUG" /&gt;
        &lt;Logger name="com.foo.services.web.controllers.FOOLoggingController"
            level="INFO"&gt;
            &lt;AppenderRef ref="UIFILE" /&gt;
        &lt;/Logger&gt;
        &lt;Root&gt;
            &lt;AppenderRef ref="STDOUT" /&gt;
            &lt;AppenderRef ref="FILE" /&gt;
        &lt;/Root&gt;
    &lt;/Loggers&gt;
&lt;/Configuration&gt;
</code></pre>

<p>everything works fine but I get a new line between outputs, don't know why! </p>

<p><a href="https://i.stack.imgur.com/vy6L3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vy6L3.jpg" alt="enter image description here"></a></p>

<p>I tried few things like removing %n from the pattern layout but when i do this, the log itself stops coming. The file output is good. It doesn't prints new line in between. Has someone faced a similar issue?</p>