title: Using java.util.logger with a separate thread to write on file?
body: <p>I have 2 FileHandlers that write out to two separate files, and the amount of I/O occurring is slowing down my application quite a bit:</p>
  
  <ol>
  <li><p>I've decided to have the FileHandlers run on separate threads.</p></li>
  <li><p>As they are on separate threads, I needed a concept of a "queue", so that these separate threads can poll this queue and print out any incoming messages.</p></li>
  <li><p>I've preformatted messages so that any arguments used do not change before they actually reach the print out in the FileHandler.</p></li>
  <li><p>Now I've realised that I can't use the "log" methods provided by the logger, as that attempts to invoke methods on the current thread to format and print out the messages.</p></li>
  <li><p>So I simply call a method that adds my trace message to the queue.</p></li>
  <li><p>I then use run() method of the FileHandlers to print out the messages using publish().</p></li>
  <li><p>I now realise publish() only takes in a LogRecord, which is just a level + message.</p></li>
  <li><p>My traces have much more, which can't simply be placed in an overall message, I want to be able to use the "Formatter" that I've set to the FileHandler.</p></li>
  <li><p>So I create an instance of the logger in the FileHandler, so I can use the log method and format the string as designed in the Formatter.</p></li>
  </ol>
  
  <p>Which works, kinda.</p>
  
  <p>...</p>
  
  <p>This is getting a bit silly, is it worth continuing on like this, working AROUND the java.util.Logger rather than working with it? One of the useful parts of the java.util.Logger is having a separate logger instance for each class and being able to have more control over the messages...</p>
  
  <p>Any suggestions? </p>
  
  <p>The code is quite long, but I think it's easily understood from the description above, if not let me know and I'll upload somewhere.</p>