I use the following lines to redirect my console output to a file :
PrintStream stream = new PrintStream("console.log");
System.setOut(stream);
Now the file is overwritten with every start of the application, thus losing all previous entries, but i´d like it to append every session to a persistent console logfile. Is it possible ?
This should work:
PrintStream stream = new PrintStream(new FileOutputStream("console.log", true));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With