Code example for FileHandler

Methods: setFormatter

0
		// Get the global logger to configure it 
		Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
 
		logger.setLevel(Level.INFO);
		fileTxt = new FileHandler("Logging.txt");
		fileHTML = new FileHandler("Logging.html");
 
		// Create txt Formatter 
		formatterTxt = new SimpleFormatter();
		fileTxt.setFormatter(formatterTxt);
		logger.addHandler(fileTxt);
 
		// Create HTML Formatter 
		formatterHTML = new MyHtmlFormatter();
		fileHTML.setFormatter(formatterHTML);
		logger.addHandler(fileHTML);
	} 
} 
Connect your IDE to all the code out there  Get Codota for Java