redirect stdout and stderr to files