title: AsyncAppender does not wait for buffer to be full before writing
body: <p>I am learning about Log4j currently and the book I am using is explaining AsyncAppenders. I set a buffer size to be 128 (LoggingEvents). The book explains that no messages will be printed until the buffer size is reached, however my program prints the logging messages regardless of the buffer size.</p>
  
  <p>Why is this the case? I would appreciate any other pointers about AsyncAppenders if anyone has knowledge about using them :)</p>
  
  <p>Log4j.xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt;
  
      &lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
      debug="true"&gt;
  
      &lt;appender name="ASYNC" class="org.apache.log4j.AsyncAppender"&gt;
      &lt;appender-ref ref="CONSOLE"/&gt;
      &lt;param name="BufferSize" value="128"/&gt;
      &lt;/appender&gt;
  
      &lt;appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"&gt;
      &lt;layout class="org.apache.log4j.PatternLayout"&gt;
      &lt;param name="ConversionPattern" value="%d %-5p [%t] - %m%n"/&gt;
      &lt;/layout&gt;
      &lt;/appender&gt;
  
      &lt;logger name="org.example.christopher" additivity="false"&gt;
      &lt;level value="debug"/&gt;
      &lt;appender-ref ref="ASYNC"/&gt;
      &lt;/logger&gt;
      &lt;root&gt;
      &lt;priority value="debug"/&gt;
      &lt;/root&gt;
      &lt;/log4j:configuration&gt;
  </code></pre>
  
  <p>Java code</p>
  
  <pre><code>package org.example.christopher;
  
  import org.apache.log4j.*;
  import org.apache.log4j.xml.DOMConfigurator;
  
  
  public class AsyncLogging{
  
  private static Logger logger = Logger.getLogger(AsyncLogging.class.getPackage().getName());
  private AsyncAppender asyncAppender = null;
  private ConsoleAppender consoleAppender = null;
  
  public AsyncLogging(){
  
  try{
  logger.setAdditivity(false);
  asyncAppender = (AsyncAppender) logger.getAppender("ASYNC");
  asyncAppender.setBufferSize(128);
  }
  catch (Exception e){
  System.out.println("error: " + e.toString());
  }
  
  }
  
  public void doLogging(){
  logger.debug("Debug 1");
  logger.debug("Debug 2");
  logger.debug("Debug 3");
  //logger.debug("Debug 4");
  //logger.debug("Debug 5");
  }
  
  
  public static void main(String ... args){
  AsyncLogging asyncLogging = new AsyncLogging();
  asyncLogging.doLogging();
  }
  
  }
  </code></pre>