I have a python app in a remote server that i need to debug, when I run the app locally it prints some debug information (including python tracebacks) that i need to monitor.
Im trying to redirect all the output of the program to a file so I can monitor the remote output using tail -F, here I found the following command to redirect the outputs:
ssh root@myserver 'nohup python /root/python/run_dev_server.py &>> /var/log/myapp.log &'
This gets me almost exactly what i want, loggin information and python tracebacks, but i do not get any of the information displayed using print from python, which i need.
so I also tried this command:
ssh root@myserver 'nohup python /root/python/run_dev_server.py 2>&1 >> /var/log/myapp.log &'
this logs the output of the program from print and also the logging information, but all the tracebacks are sent to my local terminal where i excecuted the the script and my script gets stuck waiting for any exception to happen in the remote program.
Is there a way I can capture all the information produced by the app without stopping my script?
Thanks in advance for any suggestion.