Log To File with FileHandler
//: c15:LogToFile.java // {Clean: LogToFile.xml,LogToFile.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.*; public class LogToFile { private static Logger logger = Logger.getLogger("LogToFile"); public static void main(String[] args) throws Exception { logger.addHandler(new FileHandler("LogToFile.xml")); logger.info("A message logged to the file"); } } ///:~