To redirect stdout to a truncated file in Bash, I know to use:
cmd > file.txt
To redirect stdout in Bash, appending to
This should work fine:
your_command 2>&1 | tee -a file.txt
It will store all logs in file.txt as well as dump them on terminal.