Simplest way without changing code:

your_excutable > your_file
or
your_excutable >& your_file