Code example for ConsoleHandler

Methods: setFormatter

0
     */ 
    public static void init() 
    { 
        ConsoleLogFormatter var0 = new ConsoleLogFormatter();
        loggerLogManager.setUseParentHandlers(false);
        ConsoleHandler var1 = new ConsoleHandler();
        var1.setFormatter(var0);
        loggerLogManager.addHandler(var1);
 
        try 
        { 
            FileHandler var2 = new FileHandler("server.log", true);
            var2.setFormatter(var0);
            loggerLogManager.addHandler(var2);
        } 
        catch (Exception var3)
        { 
            loggerLogManager.log(Level.WARNING, "Failed to log to server.log", var3);
        } 
    } 
Stop searching for code, let great code find you!  Add Codota to your java IDE