This code I am using creates an empty file each time and thus my file contains only 1 line all the time.
What I would like to do is append to the file if it exists or create it and append if it does not exist.
private void saveToLogFile(String s) throws FileNotFoundException {
PrintWriter pw=new PrintWriter(myLoggerFile);
pw.append(s);
pw.flush();
}