The answer(s) to this question explains how to print stdout and stderr to the terminal, while also redirecting them to a file:
program [arguments...] 2>&1 | tee outfile
How could this be extended if stdout and stderr should be redirected in 2 different files ?