Example usage for java.util.logging Handler setEncoding

List of usage examples for java.util.logging Handler setEncoding

Introduction

In this page you can find the example usage for java.util.logging Handler setEncoding.

Prototype

public synchronized void setEncoding(String encoding)
        throws SecurityException, java.io.UnsupportedEncodingException 

Source Link

Document

Set the character encoding used by this Handler .

Usage

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;
}