It's great to keep logs of things to go back and find out what happened, but sometimes it's also useful to have the information there on the screen so you can see what's going on at the time. I discovered a nice way of doing this using tee which I thought I'd share:
echo -e "First line\nSecond line" | tee /path/to/log.file
echo -e "Third line" | tee -a /path/to/log.file
The first line creates the file, then the second (and then subsequent lines) use the -a switch to append to the file. It's a nice easy way of making sure that your output goes to two places at once. Of course, you could use any command at the start of the line, not just echo.
Image by Dmitry Baranovskiy.