U use redirectoutput. This will redirect all screen output to the file you specified.
Adding $rc = in front of all the commands/functions in the script, check if they are not 0 (no error all OK) and if so write to the log file would solve your problems.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.