List of usage examples for java.util.logging FileHandler publish
@Override public synchronized void publish(LogRecord record)
From source file:Main.java
public static void main(String args[]) throws Exception { XMLFormatter formatter = new XMLFormatter(); LogRecord record = new LogRecord(Level.INFO, "XML message.."); FileHandler handler = new FileHandler("newxml.xml"); handler.setFormatter(formatter);/*w ww.j a v a2 s .c o m*/ handler.publish(record); handler.flush(); }