There’s a good chance that `prog1` is writing its output to standard error. You can redirect both outputs to a single file with
prog1 prog2 > outfile.txt 2>&1
or you can split the outputs with
prog1 prog2 > outfile.txt 2> errors.txt
This doesn’t separate the individual _programs_ ’ output, it separates the output channels. See What are the shell's control and redirection operators? for details.
If you look at `prog1`’s documentation, you might find an option to tell it to store its output in a named file instead. For example, with `strace`,
strace -o strace.txt prog2 > outfile.txt
would store `strace`’s output in `strace.txt`, and everything written to standard output in `outfile.txt`.