Log multiple Handlers 2
// : c15:MultipleHandlers2.java // {Clean: MultipleHandlers2.xml,MultipleHandlers2.xml.lck} // From 'Thinking in Java, 3rd ed.' (c) Bruce Eckel 2002 // www.BruceEckel.com. See copyright notice in CopyRight.txt. import java.util.logging.ConsoleHandler; import java.util.logging.FileHandler; import java.util.logging.Logger; public class MultipleHandlers2 { private static Logger logger = Logger.getLogger("MultipleHandlers2"); public static void main(String[] args) throws Exception { FileHandler logFile = new FileHandler("MultipleHandlers2.xml"); logger.addHandler(logFile); logger.addHandler(new ConsoleHandler()); logger.setUseParentHandlers(false); logger.warning("Output to multiple handlers"); } } ///:~