Using java.util.logging to log on the console

Logging on the standard System.out stream could be easily done by adding a StreamHandler handler:

logger.addHandler(new StreamHandler(System.out, new SimpleFormatter()))

I'm no expert on java logging, but if you change log.fine() to log.info() it will print. There's something fishy about fine - in practice, I never used it. Hopefully somebody who knows more can answer that.

ADDED: Yes, fine is special. I found an earlier SO answer for this:


Very simple, a logger can have several handlers, with each a different level.

handler.setLevel(Level.ALL);