I try to use tee to save output in file like:
myapp | tee log.txt
But I have a problem with checking of exit. Previous code:
you can redirect your output to file instead:
$ myapp > log.txt