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?
-
2If you are on Linux/Unix or Mac OS, you can just pipe your program to the tee utility, that does exactly that ( man7.org/linux/man-pages/man1/tee.1.html ), with no need to modify the Java source.– FBergoCommented May 7, 2018 at 18:54
-
If you want to do it in Java, see the dupe. But tee is a fine solution.– Andy TurnerCommented May 7, 2018 at 19:01
Add a comment
|