Code example for FileHandler

0
        TEMPPATH = System.getProperty("java.io.tmpdir");
 
        File file = new File(TEMPPATH + SEP + "log");
        file.mkdir();
        manager.readConfiguration(propertiesToInputStream(props));
        handler = new FileHandler();
        r = new LogRecord(Level.CONFIG, "msg");
    } 
 
    protected void tearDown() throws Exception { 
        if (null != handler) {
            handler.close();
        } 
        reset(TEMPPATH + SEP + "log", "");
        // RoboVM note: Since we run the tests in the same process (and Android apparently doesn't) 
        // we need to clear the allLocks Map in FileHandler for all tests in here to succeed. 
        java.lang.reflect.Field f = FileHandler.class.getDeclaredField("allLocks");
        f.setAccessible(true);
        ((java.util.Map) f.get(null)).clear();
        super.tearDown(); 
    }