This is my first post and I am new to this so bear with me...I am trying to write a program that will output messages to 1 or more text files. For example if I want to write to 3 log files, depending on what is happening in the code. I may want to write to one but not the other. How do I code it for more than one file and how do I tell it which one to write to. I know how to do it for one file... how do I do it for more than one? This is what I have for one..
PrintWriter out = new PrintWriter( new BufferedWriter( new FileWriter("firstlog.txt", true))); out.print("this is a message to first log.txt"); out.close();