Seems easy enough to write console output to file, but doing so appears to hijack the output stream from the console. Is there a way to write to the console and a file simultaneously?
Asked
Active
Viewed 51 times
0
-
2If you are on Linux/Unix or Mac OS, you can just pipe your program to the **tee** utility, that does exactly that ( http://man7.org/linux/man-pages/man1/tee.1.html ), with no need to modify the Java source. – FBergo May 07 '18 at 18:54
-
If you want to do it in Java, see the dupe. But tee is a fine solution. – Andy Turner May 07 '18 at 19:01