Redirect both STDOUT and STDERR to tee
./program 2>&1 | tee program.log

CategoryComputing.Shell