Redirect all output to a single file
Shell commands often output to both standard output and standard error. If you want to send *all* of this to a log file, use the following.
The 2>&1 bit is the part that redirects standard error to standard out, allowing you to capture both.
your_shell_script >> /path/to/logfile 2>&1
The 2>&1 bit is the part that redirects standard error to standard out, allowing you to capture both.