If memory serves me you want to do something like this:
Code:
# redirect stdout to file descriptor
exec 6>&1
# redirect it to logfile
exec > /path/to/your/log/file.log
# your loop
(LOOP)
# fix your stdout and close file
exec 1>&6 6>&-
Actually, I found where my snippet came from as I was looking into this to make sure it was right (I lost a shell or two doing this with stdin.)
http://www.linuxtopia.org/online_boo...ripting_guide/
Check out chapter 16 "I/O Redirection", sub chapter 16.1 "Using exec". That has better details and more in-depth instruction than I can provide from memory.
Edit: I'd also suggest redirecting stderr or you might miss some messages from applications in your loop