title: Java logging API MemoryHandler dumping log instantly
body: <p>I want to log my application's messages after certain threshold. Say after 10 messages. I read about memory handler and used it. However I found that it logs the messages instantly instead of buffering them as said in documentation. Here's code</p>
  
  <pre><code>Handler h = new FileHandler('/var/tmp/process.log',Level.INFO);
  Handler h2 = new MemoryHandler(h, 10, Level.ALL);
  logger.addHandler(h2);
  
  for(int i=0; i&lt;10; i++) {
      logger.log(Level.INFO, "Sample message");
      Thread.sleep(1000);
  }
  </code></pre>
  
  <p>This code is adding above message instantly. What am I missing? My purpose is to not let too much disk I/O happen. Please help</p>