I'm trying to create an error report in Java, but the file reader writes over the same line every time I find a new error, so all that displays is the last error. How would I prevent this?
public void errorReport(String error)
{
try {
FileWriter fw = new FileWriter(file);
PrintWriter pw = new PrintWriter(fw);
pw.write(error);
pw.close();
} catch (IOException e)
{
e.printStackTrace();
}
} // end error report