Send STDOUT and STDERR to the appropriate files

Send STDOUT and STDERR to the appropriate files