Adds logging of R script's error output.