public void setImmediateFlush(final boolean value) {
        this.immediateFlush = value;
    }
If the <b>ImmediateFlush</b> option is set to <code>true</code>, the
appender will flush at the end of each write. This is the default
behavior. If the option is set to <code>false</code>, then the underlying
stream can defer writing to physical medium to a later time.

<p>
Avoiding the flush operation at the end of each append results in a
performance gain of 10 to 20 percent. However, there is safety tradeoff
involved in skipping flushing. Indeed, when flushing is skipped, then it
is likely that the last few log events will not be recorded on disk when
the application exits. This is a high price to pay even for a 20%
performance gain.
metamorphosis-client-extension/src/main/java/com/taobao/metamorphosis/client/extension/log4j/StreamAppender.java