import java.io.*; import java.util.logging.*; public class SetXmlFormatter{ public static void main(String[] args){ Logger log = Logger.getLogger("RoseIndia.Net"); try{ FileHandler xhand = new FileHandler("vinod.xml",true); xhand.setFormatter(new XMLFormatter()); log.addHandler(xhand); log.info("This is info message"); log.warning("This is warning message"); } catch (IOException e){ System.out.println(e.getMessage()); System.exit(0); } } }