Used the bash --exec trick to log stderr to a logfile.