There is a Java command to redirect standard output to a file or back to the standart output:
PrintStream stdout = System.out;
System.setOut(new PrintStream(logFile));
// ...
System.setOut(stdout);
But I need to have both of them. Is it possible to set standard output in Java both to the file and to the standard output?