Code example for SimpleFormatter

0
            // 
            // Creating an instance of FileHandler with 5 logging files 
            // sequences. 
            // 
            FileHandler handler = new FileHandler("myapp.log", FILE_SIZE, 5, true);
            handler.setFormatter(new SimpleFormatter());
            logger.addHandler(handler);
            logger.setUseParentHandlers(false);
        } catch (IOException e) {
            logger.warning("Failed to initialize logger handler.");
        } 
 
        logger.info("Logging information message.");
        logger.warning("Logging warning message.");
    } 
} 
Contextual code suggestions in your IDE  Get Codota for Java