Writing Log Records to a Log File
import java.util.logging.FileHandler; import java.util.logging.Logger; public class Main { public static void main(String[] argv) throws Exception { FileHandler handler = new FileHandler("my.log"); Logger logger = Logger.getLogger("com.mycompany"); logger.addHandler(handler); } }