List of usage examples for java.util.logging Handler setEncoding
public synchronized void setEncoding(String encoding) throws SecurityException, java.io.UnsupportedEncodingException
From source file:com.ebixio.virtmus.stats.StatsLogger.java
/** Creates a log handler for the stats logging. * @param newLogSet An identifier: "A" or "B". *///from w w w .j a va 2s. com private Handler makeLogHandler(String newLogSet) { Handler handler = null; try { String pattern = "VirtMus-" + newLogSet + "-%g.log"; File logFile = getLogFile(pattern); handler = new FileHandler(logFile.getAbsolutePath(), 50 * 1000 * 1000, 10, true); handler.setFormatter(new XMLFormatter()); handler.setEncoding("utf-8"); } catch (IOException | SecurityException ex) { Log.log(ex); } return handler; }