redirect stdout and stderr to log