I have a issue with my raspberry pi that starts up a python script it generates a exception somewhere and I have catched all errors which are printed into the terminal (if running from idle).
But how do I save the printed output to a file when it is running on boot? I found this script below on the internet but it doesn't seem to write the printed text,it creates the file but the content is empty (every 30 sec it should print 'Checking')
This is the code that is being executed after the pi has booted and it shows the GUI elements perfectly (and yes sudo is required due to the GPIO pins)
#!/bin/sh
startx
sudo python /home/pi/python_gui.py > /home/pi/output.log
Hopefully someone knows a answer, thanks in advance!