Here you can find the source of logString(String logtext)
public static void logString(String logtext)
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStreamWriter; public class Main { public static void logString(String logtext) { File file = new File("outputs/log/log.txt"); BufferedWriter bw = null; try {/*ww w . ja v a2 s . c om*/ // append mode = true bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true))); bw.write(logtext + "\n"); bw.flush(); } catch (Exception e) { e.printStackTrace(); } finally { try { bw.close(); } catch (Exception ex) { } ; } } }