import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;


public class Logger {
	private String filename;

	Logger(String filename) {
		this.filename = filename;
	}

	public void append(String line) {
		try(PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(filename, true)))) {
		    out.println(line);
		}
		catch (IOException e) {
			// fail
		}
	}
}

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;


public class Logger {
	private PrintWriter out;

	Logger(String filename) {
		try {
			out = new PrintWriter(new BufferedWriter(new FileWriter(filename, true)));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void append(String line) {
		out.println(line);
		out.flush();
	}
}

Fix logger for java 1.6
Fix logger for java 1.6
